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″ 改为”GBK”、”GB2312″、”UTF-8” ,然后点击右侧的Update ,然后点击 OK 保存即可。
如果没有提供javaScript选择向,在下面的“文件关联”中添加一个“*.js”,然后修改编码为”GBK”、”GB2312″、”UTF-8″就可以了。
    原文作者:信行合一
    原文地址: https://blog.csdn.net/tengdazhang770960436/article/details/8267291
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞