/**
* 将unicode 字符串
*
* @param str
* 待转字符串
* @return 普通字符串
*/
public String revert(String str) {
if (str != null && str.trim().length() > 0) {
String un = str.trim();
StringBuffer sb = new StringBuffer();
int idx = un.indexOf("\\u");
while (idx >= 0) {
if (idx > 0) {
sb.append(un.substring(0, idx));
}
String hex = un.substring(idx + 2, idx + 2 + 4);
sb.append((char) Integer.parseInt(hex, 16));
un = un.substring(idx + 2 + 4);
idx = un.indexOf("\\u");
}
sb.append(un);
return sb.toString();
}
return "";
}
转自:http://tryy-java.blogspot.com/2012/06/unicode-to-stringu.html