使ApplicationResources.properties支持中文

使ApplicationResources.properties支持中文
建立一个ApplicationResources_ISO.properties文件,把应用程序用的message都写进去,
然后在dos下执行这个命令,是jdk/bin中的cmd:
native2ascii -encoding gb2312 ApplicationResources_ISO.properties ApplicationResources.properties
这样就会将ISO编码的ApplicationResources转换成GB2312编码的格式了,同时保存到
ApplicationResources.properties。这个文件需要保存在 \WEB-INF\classes目录中
native2ascii这个工具是jdk自带的一个东东,所以如果path都设定正确就可以直接运行了,
你可以在$java_home$/bin下找到他。
转换后的中文类似于这个样子:
iso 格式下 :tj.type=商品车类型
gb2312格式下 :tj.type=\u5546\u54c1\u8f66\u7c7b\u578b



我们需要这个软件 Properties Editor


下载地址:
http://propedit.sourceforge.jp/index_en.html

Properties Editor 可以通过以下方式来使用:手动安装Properties Editor的Jar包  或者 通过Eclipse自动安装
Help-->Software Updates-->Find and Install-->Search for new features to install-->New Remote Site-->name:这是一个插件名 URL:http://propedit.sourceforge.jp/eclipse/updates/

你可能感兴趣的:(eclipse,jdk,html,Web,dos)