/** * @param string * @return 转换之后的内容 * @Title: unicodeDecode * @Description: unicode解码 将Unicode的编码转换为中文 */ public String unicodeDecode(String string) { Pattern pattern = Pattern.compile("(\\\\u(\\p{XDigit}{4}))"); Matcher matcher = pattern.matcher(string); char ch; while (matcher.find()) { ch = (char) Integer.parseInt(matcher.group(2), 16); string = string.replace(matcher.group(1), ch + ""); } return string; }
标签:ch,string,转码,Pattern,unicodeDecode,unicode,matcher From: https://www.cnblogs.com/wencong/p/16871799.html