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

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: