Unicode to string conversion in Java


To convert the given Unicode to an character:
i.e String unicode = “0”+91+D1+””; to a Unicode character

Following method can use in Java

char getUnicode(String codePoint) {
   return (char)  Integer.parseInt(codePoint, 16);
}
or 

String string = "0061";
char c = (char) Integer.parseInt(string, 16);
System.out.println(c);
Advertisements

Blog at WordPress.com.

%d bloggers like this: