`
zjx2388
  • 浏览: 1307414 次
  • 性别: Icon_minigender_2
  • 来自: 北京
社区版块
存档分类
最新评论

MyEclipse修改.properties文件的编码

阅读更多

MyEclipse中新建一个messageResource.properties文件,如果输入中文保存时就会提示错误:
Save could not be completed.


Reason:
some characters cannot be mapped using "ISO-8859-1" character encoding.
Either change the encoding or remove the characters which are not supported
by the "ISO-8859-1" character encoding.

 

解决办法:

方法一: 使用eclipse的jinto插件编辑,会自动调用java的native2ascii把文件转码。

方法二: 

          1. MyEclipse --> Window -->Preferences:

          2. 在“type filter text“的框框里输入”Content Types

          3. 输入完后,Eclipse 会自动进行查找,然后会在右边显示出 Content Types 的属性

     4. 点击右边的Text,选择 Java Properties File,看一下 下面的两个选项

                           <1>:File associatios:   ----- 看看里面有没有 你需要的文件类型,
                                  默认的是*.porperties(locked)
                                  我需要的*.js ,所以这时点击 Add 按钮,自己添写file type,
                                  我写的是 *.js 哦,点击ok
                           <2>:Default encoding: ----- 这里默认的值不是utf-8,
                                  也是需要自己更改,删除掉原来的,写上
                                  你需要的,然后点击Update ,就好了。

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics