在Eclipse中PropertiesEditor插件

在项目中用到国际化文件Message.properties,但里面的文本都是 unicode 格式的,用起来不爽。而且也不想通过其它工具转码来使用。 
可以通过安装 eclipse的PropertiesEditor插件来编辑。这样该插件会自动进行中文到 unicode 的转换。 
安装后,可以使用 PropertiesEditor 来编辑对应的文件,则会直接显示中文。编辑保存后会自动进行转换。如果用其它 editor 打开,则会直接显示 unicode. 

1、在eclipse中点击“help”-"Install New Software"

2、点击右侧的“Add”按钮

3、输入
Name:properties。
Location:http://propedit.sourceforge.jp/eclipse/updates/

然后点击OK

4、过一会就会出现插件列表,选择PropertiesEditor,然后Next

5、继续Next

6、点击“I accept ……”,然后Finish.

7、接下来就安装插件了

8、安装完成后点击“Restart Now”重启eclipse,重启完后properties文件前面会有一个绿色的P

通过open with–>PropertiesEditor打开*.properties文件得打开才行。为了一劳永逸,配置一下*.properties的默认打开方式就行了Window->Preferences->General->Editors->File Associations

在Eclipse中PropertiesEditor插件