Here you can find the source of unicodeEscaped(Character ch)
public static String unicodeEscaped(Character ch)
//package com.java2s; public class Main { public static String unicodeEscaped(char ch) { if (ch < 0x10) { return "\\u000" + Integer.toHexString(ch); } else if (ch < 0x100) { return "\\u00" + Integer.toHexString(ch); } else if (ch < 0x1000) { return "\\u0" + Integer.toHexString(ch); }//from w w w . j a v a 2s . c o m return "\\u" + Integer.toHexString(ch); } public static String unicodeEscaped(Character ch) { if (ch == null) { return null; } return unicodeEscaped(ch.charValue()); } }