There is a string containing some Unicode characters (actually Chinese characters), I can not convert them to their original appearance.
Method System.out.println()
just prints \u....."
Unicode strings, not the Chinese character.
This is the code I'm using:
String code = "\\" + "u751c";
System.out.println(code);
System.out.println(code.length());
code = "\u751c";
System.out.println(code);
System.out.println(code.length());
Which results in:
\u751c
6
甜
1
How can I get the actual Chinese character?
Thanks for all your comments and answers.Maybe I didn't make myself clear.The string I get may be form of ("\" + "u751c"), result of System.out.println() just returns "\u751c" not character "甜".
// text_title is the string scraped from other website using Jsoup.
System.out.println(text_title);
System.out.println("\u53f0\u6e7e\u8fdb\u53e3 Love of office lady \u5c0f\u8d44\u5973\u4e4b\u604b \u8349\u8393\u5de7\u514b\u529b\u674f\u4ec1\u5377\u5fc3\u9165 80g/\u76d2");
Content in the console:
\u53f0\u6e7e\u8fdb\u53e3 Love of office lady \u5c0f\u8d44\u5973\u4e4b\u604b \u8349\u8393\u5de7\u514b\u529b\u674f\u4ec1\u5377\u5fc3\u9165 80g/\u76d2
台湾进口 Love of office lady 小资女之恋 草莓巧克力杏仁卷心酥 80g/盒
The string text_title maybe escaped with this form ("\" + "u751c"), how can I convert it to Chinese characters?