Search code examples
javaunicodeescapingunicode-escapes

Convert International String to \u Codes in java


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


Solution

  • 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.