Java Unicode to Chinese UnicodeTochinese(String dataStr)

Here you can find the source of UnicodeTochinese(String dataStr)

Description

Unicode Tochinese

License

Open Source License

Declaration

public static String UnicodeTochinese(String dataStr) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {

    public static String UnicodeTochinese(String dataStr) {
        int index = 0;
        StringBuffer buffer = new StringBuffer();

        while (index < dataStr.length()) {
            if (!"\\u".equals(dataStr.substring(index, index + 2))) {
                buffer.append(dataStr.charAt(index));
                index++;//w w  w .ja  va  2s .  co m
                continue;
            }
            String charStr = "";
            charStr = dataStr.substring(index + 2, index + 6);
            char letter = (char) Integer.parseInt(charStr, 16);
            buffer.append(letter);
            index += 6;
        }
        return buffer.toString();
    }
}

Related

  1. unicodeToChinese(String str)
  2. unicodeToChinese(String unicode)
  3. unicodeToGB2312StrWeb(String str)