Here you can find the source of unicodeToString(int unicode)
static String unicodeToString(int unicode)
//package com.java2s; // Licensed under the Apache License, Version 2.0 (the "License"); public class Main { static String unicodeToString(int unicode) { switch (unicode) { case 0x00: return "\\0"; case 0x08: return "\\b"; case 0x09: return "\\t"; case 0x10: return "\\n"; case 0x0C: return "\\f"; case 0x0D: return "\\r"; case 0x22: return "\\\""; case 0x27: return "\\\'"; case 0x5C: return "\\\\"; default:/*from w w w. j av a2 s . c om*/ if (0x20 <= unicode && unicode <= 0x7E) { return (new Character((char) unicode)).toString(); } else { int ct[] = new int[4]; ct[0] = (unicode & 0xF000) >>> 12; ct[1] = (unicode & 0x0F00) >>> 8; ct[2] = (unicode & 0x00F0) >>> 4; ct[3] = (unicode & 0x000F); char[] temp = { '\\', 'u', 'g', 'g', 'g', 'g' }; for (int i = 0; i < 4; i++) { int tempint = (ct[i] < 10 ? ct[i] + (int) '0' : ct[i] - 10 + (int) 'A'); temp[(i + 2)] = (char) tempint; } return new String(temp); } } } }