打开一个 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 保存即可。

相关文章:

  • 2021-08-20
  • 2021-12-06
  • 2021-06-05
  • 2021-04-17
  • 2021-12-25
猜你喜欢
  • 2021-07-02
  • 2022-02-07
  • 2022-02-16
  • 2021-12-28
  • 2021-11-20
  • 2021-11-30
  • 2021-08-28
相关资源
相似解决方案