I want to store a UTF-8 string "Русслэнд"
in a Java properties file as UTF-8 literals like this "\u0420\u0443\u0441\u0441\u043b\u044d\u043d\u0434"
How can I convert this? Since Java properties files are ISO-8859-1 by default.
I want to store a UTF-8 string "Русслэнд"
in a Java properties file as UTF-8 literals like this "\u0420\u0443\u0441\u0441\u043b\u044d\u043d\u0434"
How can I convert this? Since Java properties files are ISO-8859-1 by default.
Java has a command line tool to do conversions
native2ascii -encoding UTF-8 x-utf8.txt x.properties
native2ascii -reverse -encoding UTF-8 x.properties x2-utf8.txt
Also there are comfortable properties editors that let you enter in unescaped Unicode, and can display several languages side-by-side. For instance in the standard NetBeans IDE.
Also possible is to keep the UTF-8 file as source and have maven or ant copy and convert the file to the build directory.
And then there is the option to load Properties with an encoding; a bit too specific.