Java and Japanese characters

I use Struts in my application and JSON. When I try to send Japanese characters, in my controller class I get a line like this:

&#12373 ; &#12383 ; &#12399 ; &#12414 ; &#12419 ; &#12425 ; (without spaces) 

I have to convert it to Japanese characters, but I could not find how to do it!

Please help me?

+4
source share
1 answer

What is XML encoding for unicode. Use the Apache Commons library to undo it:

 import org.apache.commons.lang.StringEscapeUtils; String input = "さ た は ま ゃ ら"; String plain = StringEscapeUtils.unescapeXml(input); System.out.println(plain); // Will print your characters 
+4
source

Source: https://habr.com/ru/post/1414886/


All Articles