Here you can find the source of toUnicode(char c)
public static String toUnicode(char c)
//package com.java2s; //License from project: Apache License import java.text.SimpleDateFormat; import java.util.Date; public class Main { public static String toUnicode(char c) { return toUnicode(String.valueOf(c)); }/*w ww.j a v a 2 s .co m*/ public static String toUnicode(String original) { if (original == null) { return ""; } StringBuilder sb = new StringBuilder(); for (int i = 0; i < original.length(); i++) { sb.append(String.format("\\u%04X", Character.codePointAt(original, i))); } String unicode = sb.toString(); return unicode; } public static String format(final String pattern, final Date date) { SimpleDateFormat formatter = new SimpleDateFormat(pattern); return formatter.format(date); } }