Here you can find the source of unescape(String data)
public static String unescape(String data)
//package com.java2s; //License from project: Open Source License public class Main { public static String unescape(String data) { StringBuilder buffer = new StringBuilder(data.length()); for (int i = 0; i < data.length(); i++) { if ((int) data.charAt(i) > 256) { buffer.append("\\u").append(Integer.toHexString((int) data.charAt(i))); } else { if (data.charAt(i) == '\n') { buffer.append("\\n"); } else if (data.charAt(i) == '\t') { buffer.append("\\t"); } else if (data.charAt(i) == '\r') { buffer.append("\\r"); } else if (data.charAt(i) == '\b') { buffer.append("\\b"); } else if (data.charAt(i) == '\f') { buffer.append("\\f"); } else if (data.charAt(i) == '\'') { buffer.append("\\'"); } else if (data.charAt(i) == '\"') { buffer.append("\\\""); } else if (data.charAt(i) == '\\') { buffer.append("\\\\"); } else { buffer.append(data.charAt(i)); }/*from ww w . j a v a 2s . co m*/ } } return buffer.toString(); } }