public class Unicode {
/**
* character to unicode
*/
public static String encode(char c) {
return Integer.toHexString((int) c & 0xffff);
}
/**
* unicode to character
*/
public static char decode(String unicode) {
return (char) Integer.parseInt(unicode, 16);
}
}
/**
* character to unicode
*/
public static String encode(char c) {
return Integer.toHexString((int) c & 0xffff);
}
/**
* unicode to character
*/
public static char decode(String unicode) {
return (char) Integer.parseInt(unicode, 16);
}
}