下面的程序可以满足你的要求 String unicode = "\\u4F60\\u597D"; String ret = null;
String[] rets = unicode.split("\\\\u"); char[] chars = new char[rets.length]; int i = 0; for(String s:rets){ if(s.equals(""))continue; chars[i] = (char)Integer.parseInt(s,16); i++; } ret = new String(chars); ret = new String(ret.getBytes("utf-8"),"utf-8"); System.out.println("Show transformed Unicode:"+ret);
String unicode = "\\u4F60\\u597D";
String ret = null;
String[] rets = unicode.split("\\\\u");
char[] chars = new char[rets.length];
int i = 0;
for(String s:rets){
if(s.equals(""))continue;
chars[i] = (char)Integer.parseInt(s,16);
i++;
}
ret = new String(chars);
ret = new String(ret.getBytes("utf-8"),"utf-8");
System.out.println("Show transformed Unicode:"+ret);