Convert International String to \u Codes in java

后端 未结 12 2025
离开以前
离开以前 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:23

    In case you need this to write a .properties file you can just add the Strings into a Properties object and then save it to a file. It will take care for the conversion.

提交回复
热议问题