---
title: "ApplicationResources.properties文件中文乱码问题的解决"
author: "oxidy"
date: "2008-10-13T14:46:14Z"
tags: []
slug: "applicationresources-properties"
draft: false
lastmod: "2008-10-13T14:46:14Z"
id: 252200
url: "https://oxidy.iteye.com/blog/252200"
---

Poperties Editor 插件------自动解决ApplicationResources.properties中汉字乱码问题 写道

今日做了个struts验证小程序，显示ApplicationResources.properties中汉字提示信息，结果显示乱码。怎么也没解决，后来发现一个插件Poperties Editor，只要装上，就可以自动解决这个问题。下面找了安装方法：

Poperties Editor介绍  
一个在编辑完成后可以将资源文件中的中文编码格式转换为unicode编码的插件，在开发国际化应用程序的时候非常有用  
http://propedit.sourceforge.jp/eclipse/updates/  
  主页为：[http://propedit.sourceforge.jp/index\_en.html](http://propedit.sourceforge.jp/index_en.html)  
安装方法：在线安装Poperties Editor  
启 动eclipse，点菜单Help -&gt; SoftWare Updates -&gt; find and install-&gt;选中Search for new features to install -&gt;next-&gt;点击 New Remote site-&gt;给这个更新站点取个名字如：luanma,url填写http://propedit.sourceforge.jp/eclipse/updates即可。-&gt;点击ok -&gt;选中刚才新加的站点名称，点击finish-&gt;他会自动找出与你所用的eclipse版本相适应的插件全部选中-&gt;后面只要选择 install all即可  
\-&gt;最后会提示你重起你的eclipse

所有的properties文件名的前面都有一个绿色的p字.见下图:  
![](http://p.blog.csdn.net/images/p_blog_csdn_net/aspnet2002web/2007-12-09P.jpg)  
.这就表明ok  
注意：当你安装完之后，那个properties文件里有中文，你编译之后它自动就会转化了。

 

这是在网络上找到的，有好几篇文章都是一样的，不知道出自谁的文章了，所以暂时没有找到原文，希望作者看到后能联系我。我会给出原始地址的。

 

还有一个类似的比较好的插件是：

ResourceBundle Editor

主页为：[http://sourceforge.net/projects/eclipse-rbe/](http://propedit.sourceforge.jp/index_en.html)

for Eclipse 3.x暂时的最新版本为0.7.7版本

说明：

ResourceBundle Editor是一个用于编辑本地化的属性文件(localized properties files)。  
它让你通一个屏幕就能够同时管理所有相关联属性文件中的key/value信息。  
它所具有的功能包括：自动为Keys分类，能够提示丢失掉的，重复的，相似的values等．

 

在[http://blog.chinaunix.net/u1/57282/showart\_469053.html](http://blog.chinaunix.net/u1/57282/showart_469053.html) 中写道第二种方法

ApplicationResources.properties中文汉字解决方案 写道

方法二:  
在jdk的bin文件夹里有个专门转unicode的应用程序　native2ascii.exe

具体操作如下：  
1、把你要转换的文字写到一个文件里，如c:\\test.txt  
2、在cmd方式中转到bin目录，如C:\\j2sdk1.4.2\_04\\bin  
3、输入命令 native2ascii c:\\test.txt &gt; c:\\out.txt  
4、将out.txt里对应的编码替代原文件的编码即可

当然也可以这样

native2ascii -encoding gb2312 ApplicationResources.properties ApplicationResources\_zh.properties