How to find the Unicode equivalent of the char?
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Rambo_Rambo
Posted On:   Thursday, February 24, 2005 12:13 AM


Say

char aChr = 'u091c';




And If I set the value of the char to a UTF-8 charset support Component say a textpane then it will display the corresponcing the equivalent of the char.



But if I have a char value and I want to find out the unicode equivalent of the same. Then How I can find it out?

Re: How to find the Unicode equivalent of the char?

Posted By:   Anonymous  
Posted On:   Thursday, February 24, 2005 05:52 AM

The following may be slow performance wise, but for small set of text in a textpane should suffice:



char c = 'u091c';
StringBuffer sb = new StringBuffer(Integer.toHexString(c));
while (sb.length() < 4) {
sb.insert(0, 0);
}

String hexValue = sb.toString();



hexValue will equal 091c
About | Sitemap | Contact