This is not necessary anymore since Eclipse 4.2 (Juno, 2012). Eclipse will take care of this transparently when you use the builtin properties file editor. It will present and accept the values in UTF-8, but it will under the covers silently convert to \uXXXX
format. Noted should be that this has some strange side effects in combination with Git plugin (e.g. old lines deleted during merge), it works best if you close all properties files before pulling/pushing.
If you're not on Eclipse 4.x yet, consider using native2ascii
tool found in /bin
folder of the JDK installation directory to convert UTF-8 properties files to ASCII properties files, as described in javadoc of java.util.Properties
class.
You can keep the "original" properties files (give them for example an .utf8
extension) and use a batch/shell file to convert them like this:
cd c:\path\to\properties\files
c:\path\to\jdk\bin\native2ascii.exe -encoding UTF-8 text_cs.properties.utf8 text_cs.properties
c:\path\to\jdk\bin\native2ascii.exe -encoding UTF-8 text_ja.properties.utf8 text_ja.properties
c:\path\to\jdk\bin\native2ascii.exe -encoding UTF-8 text_zh.properties.utf8 text_zh.properties
# You can add more properties files here.
This way you can just edit the .utf8
files and run the batch/shell script once to do the conversion of native characters to \uXXXX
. Also see this blog entry.
See also: