Java Unicode to hex string -


this question has answer here:

the code below gives me unicode string கா

sysout = new printstream(system.out, true, "utf-8"); sysout.println("\u0b95\u0bbe"); 

by giving கா input, can hex values \u0b95 , \u0bbe?

ps: tamil language.

according this you'll have try

system.out.println( "\\u" + integer.tohexstring('க' | 0x10000).substring(1) ); 

but work on unicode 3.0. if want more values, create loop, e.g.

string foo = "கா"; (int = 0; < foo.length(); i++)     system.out.println( "\\u" + integer.tohexstring(foo.charat(i) | 0x10000).substring(1)); 

which produces

\u0b95 \u0bbe 

if want have them in 1 line, change system.out.println() system.out.print() , add system.out.print("\n") in end.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

javascript - jQuery .height() return 0 when visible but non-0 when hidden -