Convert International String to \u Codes in java

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

    Apache commons StringEscapeUtils.escapeEcmaScript(String) returns a string with unicode characters escaped using the \u notation.

    "Art of Beer 

提交回复
热议问题