TA的每日心情 | 开心 2021-3-12 23:18 |
---|
签到天数: 2 天 [LV.1]初来乍到
|
怎样制作*_zh_CN.properties 中文资源文件。
利用程序native2asci.exe,它在JDK/BIN 目录下,使用格式:
native2ascii [-reverse] [-encoding encoding] [inputfile [outputfile]]
正转:To:Unicode
native2ascii -encoding gb2312 source.properties target.properties
反转:Reverse Unicode To 指定码
native2ascii -reverse -encoding Big5 source22.properties target2.properties
当然可以写成批处理文件.bat自动转化 1 先写系统变量,要将native2asci.exe放到path路径中:
set path= c:jdk1.5in;... 2 建一个run.bat文件 del ApplicationResources_zh_CN.properties
native2ascii -encoding gb2312 beyond.properties ApplicationResources_zh_CN.properties 3.例子:C:Tomcat 5.0webappsstrutsjb9WEB-INFclasseseyond.properties
error.login.username=<li>不存在该用户名
error.login.nullusername=<li>用户名不能为空
error.login.password=<li>密码错误
errors.footer=</font></ul>
errors.header=<ul><font color="red">
将run.bat文件复制到C:Tomcat 5.0webappsstrutsjb9WEB-INFclasses下,并运行! 然后你再打开ApplicationResources_zh_CN.properties 就看到效果了
|
|