Wednesday, March 25, 2020

Encode and Decode Unicode Japanese Character using Java

For example we can try to use a Japanese word i.e, "katakana" in Japanese 片仮名

To Convert Japanese Character into Unicode, use below link
https://www.branah.com/unicode-converter

片仮名 -> \u7247\u4eee\u540d

Java Code:

String data = "Testing String is: \u7247\u4eee\u540d";
byte[] utf8 = data.getBytes("UTF-8");

data = new String(utf8, "UTF-8");
System.out.println("Decoded String:"+data);


Output:

Testing String is: 片仮名

No comments:

Post a Comment

Popular Posts