Here you can find the source of toUnicodeEscape(int ch)
private static String toUnicodeEscape(int ch)
//package com.java2s; //License from project: Apache License public class Main { private static String toUnicodeEscape(int ch) { return "\\u" + String.format("%04X", ch); }// ww w .j a v a 2 s .c o m }