日期:2014-05-16  浏览次数:20320 次

eclipse无法正常保存js
错误 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. 很明显,是因为 js 文件里面有中文字符导致的,但是我的项目属性里面设置了以 utf-8 编码,而且用记事本打开另存为 utf-8 编码仍然解决不了问题。后来经过查阅网上的资料,原来 js 文件默认是 ISO8859-1 编码,解决方法如下: 在 Window 菜单里面找到 Preferences , 在打开的窗口左侧找到 General -> Content Type ,然后在右侧的窗口里面可以看到 text ,点开前面的小三角,后找到 javascript , 在最下面的 Default Encoding 里面,将 ISO8859-1 改为 UTF-8 ,然后点击右侧的 Update ,然后点击 OK 保存即可。