无法创建包含外语字符的文件
当尝试使用外语字符保存属性文件(包含名称/值对)时,出现以下错误。如何设置编码?
保存无法完成。某些字符无法使用以下方式映射 “cp1252”字符编码。更改编码或删除 “Cp1252”字符编码不支持的字符。
I get the following error, when trying to save a properties file (containing name/value pairs) with foreign language characters. How do I set the encoding?
Save could not be completed. Some characters cannot be mapped using
"Cp1252" character encoding. Either change the encoding or remove the
characters which are not supported by the "Cp1252" character encoding.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
我认为它会日食:
I presume its eclipse:
这看起来像日食。
That looks like Eclipse.
假设它在 Eclipse 中,最简单的方法是选择错误对话框中的“另存为 UTF-8”选项。
其他答案也很好用。
Assuming it is in Eclipse, easiest way is to choose Save as UTF-8 option present in the error dialog box.
The other answers work well too.
对此,最好的解决方案是我总是这样做。就是转到工作区中的相应文件,在记事本++中打开它并进行所需的更改。完成后,保存文件。
您的 Eclipse 将要求您更新代码并进行更改。单击“是”。
现在就可以出发了。
Best possible solution for this , which I always do .Is to go the respective file in your workspace open it in notepad++ and make the desired changes. Once done , save the file.
Your eclipse will ask you to update the code with the changes . Click yes.
And you are all good to go now.
首先复制该文件并删除该文件,然后在创建具有相同内容的文件后在 Eclipse 中删除您的代码
并重写它将解析的代码。
Fist copy the file and delete that file and then cleat your code in the eclipse after
create file with same content and rewrite the code it will resolve.