首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 企业软件 > 行业软件 >

unicode 转汉语言

2012-07-02 
unicode 转中文public class Conversion {?public static String convert(String source) {??if (null

unicode 转中文

public class Conversion {
?public static String convert(String source) {
??if (null == source || " ".equals(source)) {
???return source;
??}

??StringBuffer sb = new StringBuffer();
??int i = 0;
??while (i < source.length()) {
???if (source.charAt(i) == '\\') {
????int j = Integer.parseInt(source.substring(i + 2, i + 6), 16);
????sb.append((char) j);
????i += 6;
???} else {
????sb.append(source.charAt(i));
????i++;
???}
??}
??return sb.toString();
?}

}

热点排行