Here you can find the source of toUnicode(StringBuilder strBuilder, char ch)
private static void toUnicode(StringBuilder strBuilder, char ch)
//package com.java2s; /*//from ww w.ja va2 s.c om * MoXie (SysTem128@GMail.Com) 2009-3-11 10:06:36 * * Copyright © 2008-2009 Zoeey.Org * Code license: GNU Lesser General Public License Version 3 * http://www.gnu.org/licenses/lgpl-3.0.txt */ public class Main { private static final char[] hexs = "0123456789abcdef".toCharArray(); private static void toUnicode(StringBuilder strBuilder, char ch) { /** * standard unicode format */ strBuilder.append("\\u"); for (int i = 4; i > 0; i--) { strBuilder.append(hexs[(ch & 0xf000) >> 12]); ch <<= 4; } } }