Here you can find the source of unescape(String str)
public static String unescape(String str)
//package com.java2s; //License from project: LGPL public class Main { public static String unescape(String str) { if (str == null) { return str; }//from w w w .ja va2 s . c o m String temp = str, sub; temp = ""; char ch = ' '; int index = str.indexOf("%u"); while (index >= 0) { temp += str.substring(0, index); sub = str.substring(index + 2, index + 6); str = str.substring(index + 6, str.length()); try { ch = (char) Integer.parseInt(sub, 16); temp += new String(new char[] { ch }); } catch (NumberFormatException e) { temp += sub; } index = str.indexOf("%u"); } temp += str; // temp = URLDecoder.decode(temp); index = temp.indexOf("%"); String temp1 = ""; while (index >= 0) { temp1 += temp.substring(0, index); sub = temp.substring(index + 1, index + 3); temp = temp.substring(index + 3, temp.length()); try { ch = (char) Integer.parseInt(sub, 16); temp1 += new String(new char[] { ch }); } catch (NumberFormatException e) { temp1 += sub; } index = temp.indexOf("%"); } temp1 += temp; return temp1; } }