Here you can find the source of unescape(String str)
private static String unescape(String str)
//package com.java2s; //License from project: Apache License public class Main { private static String unescape(String str) { StringBuilder sb = new StringBuilder(); String[] codeStrs = str.split("\\\\u"); for (String codeStr : codeStrs) { if (codeStr.isEmpty()) { continue; }/*from ww w .j av a 2 s . c om*/ try { if (codeStr.length() <= 4) { sb.append(Character.valueOf((char) Integer.parseInt( codeStr, 16))); } else { sb.append(Character.valueOf((char) Integer.parseInt( codeStr.substring(0, 4), 16))); sb.append(codeStr.substring(4)); } } catch (NumberFormatException e) { sb.append(codeStr); } } return sb.toString(); } }