Unicode转字符串

    private String unicodeToString(String string) {
        StringBuffer stringBuffer = new StringBuffer() ;
        String pattern = "\\u[0-9,a-f,A-F]{4}";
        Matcher matcher = Pattern.compile(pattern).matcher(string);
        while (matcher.find()) {
            char c = (char) Integer.parseInt(matcher.group().replaceAll("\\u", ""), 16);
            matcher.appendReplacement(stringBuffer, new String(new char[]{c}));
        }
        matcher.appendTail(stringBuffer);
        return stringBuffer.toString();
    }
原文地址:https://www.cnblogs.com/LOVE0612/p/10411611.html