站内搜索: 请输入搜索关键词

当前页面: 开发资料首页Java 专题怎样制作*_zh_CN.properties中文资源文件

怎样制作*_zh_CN.properties中文资源文件

摘要: 怎样制作*_zh_CN.properties中文资源文件

</td> </tr> <tr> <td height="35" valign="top" class="ArticleTeitle"> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="175" height="86" align="center" valign="top"> </td> <td width="509" valign="top">怎样制作*_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.5\bin;...

2 建一个run.bat文件

del ApplicationResources_zh_CN.properties
native2ascii -encoding gb2312 beyond.properties ApplicationResources_zh_CN.properties

3.例子:C:\Tomcat 5.0\webapps\strutsjb9\WEB-INF\classes\beyond.properties

error.login.username=

  • 不存在该用户名
    error.login.nullusername=
  • 用户名不能为空
    error.login.password=
  • 密码错误
    errors.footer=
    errors.header=