properties 文件里的资源必须经过编码,不能出现中问,日文等。且必须是ASCII 码。
jdk 中bin 文件夹下的native2ascii.exe 可以把资源转换为ascii 码。
在命令提示符中输入
native2ascii [-encoding UTF-8] [sourcefile] [targetfile] 可以整个文件按utf-8编码转换为ascii 码
例一:native2ascii -encoding UTF-8 d:test.txt d:test_zh_CN.properties
输入native2ascii [sourcefile] [targetfile]可以按默认编码转为ascii 码
例二:native2ascii d:test.txt d:test2_zh_CN.properties
输入 native2ascii -reverse [sourcefile] [targetfile] 可以把ascii 转换为本地资源文件
例三:native2ascii -reverse d:test_zh_CN.properties d:text2.txt