Tuesday, September 15, 2009

Converting a Chinese/ other language string into Unicode (UTF-16)

String b = --some chinese or other language text ---

StringBuffer str = new StringBuffer();
for(int i=0; i<b.length(); i++)
{
str.append(Integer.toHexString(b.charAt(i)));
}
System.out.println(" changed:--- "+str.toString());

No comments:

Post a Comment