Convert International String to \u Codes in java

后端 未结 12 2048
离开以前
离开以前 2020-11-29 02:53

How can I convert an international (e.g. Russian) String to \\u numbers (unicode numbers)
e.g. \\u041e\\u041a for OK ?

12条回答
  •  被撕碎了的回忆
    2020-11-29 03:12

    There's a command-line tool that ships with java called native2ascii. This converts unicode files to ASCII-escaped files. I've found that this is a necessary step for generating .properties files for localization.

提交回复
热议问题