Here you can find the source of toUnicodeStr(int i)
public static String toUnicodeStr(int i)
//package com.java2s; /*//from w ww. j av a2 s.c o m * Xapp (pronounced Zap!), A automatic gui tool for Java. * Copyright (C) 2009 David Webber. All Rights Reserved. * * The contents of this file may be used under the terms of the GNU Lesser * General Public License Version 2.1 or later. * * Software distributed under the License is distributed on an "AS IS" basis, * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License * for the specific language governing rights and limitations under the * License. */ public class Main { public static String toUnicodeStr(int i) { char c1 = Integer.toHexString((i >> 12) & 0x0000000F).charAt(0); char c2 = Integer.toHexString((i >> 8) & 0x0000000F).charAt(0); char c3 = Integer.toHexString((i >> 4) & 0x0000000F).charAt(0); char c4 = Integer.toHexString((i) & 0x0000000F).charAt(0); return "\\u" + c1 + c2 + c3 + c4; } }