81,092
社区成员
发帖
与我相关
我的任务
分享
public static String unicodeToString(String str) {
Pattern pattern = Pattern.compile("(&#x(\\p{XDigit}{4}))");
Matcher matcher = pattern.matcher(str);
char ch;
while (matcher.find()) {
ch = (char) Integer.parseInt(matcher.group(2), 16);
str = str.replace(matcher.group(1), ch + "");
}
return str;
}