Here you can find the source of unEscapeString(String str)
public static String unEscapeString(String str)
//package com.java2s; //License from project: Apache License public class Main { public static String unEscapeString(String str) { if (str == null) return null; str = str.replaceAll("%20", " "); str = str.replaceAll("%3C", "<"); str = str.replaceAll("%3E", ">"); str = str.replaceAll("%23", "#"); str = str.replaceAll("%7B", "{"); str = str.replaceAll("%7D", "}"); str = str.replaceAll("%7C", "|"); str = str.replaceAll("%5C", "\\\\"); str = str.replaceAll("%0A", "\n"); str = str.replaceAll("%5E", "^"); str = str.replaceAll("%7E", "~"); str = str.replaceAll("%5B", "["); str = str.replaceAll("%5D", "]"); str = str.replaceAll("%60", "'"); str = str.replaceAll("%3B", ";"); str = str.replaceAll("%2F", ","); str = str.replaceAll("%3F", "?"); str = str.replaceAll("%3A", ":"); str = str.replaceAll("%40", "@"); str = str.replaceAll("%3D", "="); str = str.replaceAll("%26", "&"); str = str.replaceAll("%24", "$"); str = str.replaceAll("%E4", "\u00e4"); str = str.replaceAll("%C4", "\u00c4"); str = str.replaceAll("%F6", "\u00f6"); str = str.replaceAll("%D6", "\u00d6"); str = str.replaceAll("%FC", "\u00fc"); str = str.replaceAll("%DC", "\u00dc"); str = str.replaceAll("%DF", "\u00df"); str = str.replaceAll("%25", "%"); str = str.replaceAll("%22", "\""); str = str.replaceAll("%2C", ","); return str; }//w w w . java 2s . com }