没有 BOM 的 UTF-8 [英] UTF-8 without BOM

查看:36
本文介绍了没有 BOM 的 UTF-8的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有 javascript 文件,我需要将它们保存为 UTF-8(无 BOM),每次我在 Notepad++ 中将它们转换为正确的格式时,它们都会恢复为 UTF-8当我在 Visual Studio 中打开它们时带有 BOM.我怎样才能阻止 VS2010 这样做?

I have javascript files that I need them to be saved in UTF-8 (without BOM), every time I convert them to the correct format in Notepad++, they are reverted back to UTF-8 with BOM when I open them in Visual Studio. How can I stop VS2010 from doing that?

另一个问题,在 Visual Studio 中没有签名的 UTF-8 和没有 BOM 的 UTF-8 是一样的吗?

Another question, is UTF-8 without signature in Visual Studio the same as UTF-8 without BOM?

推荐答案

BOM 或字节顺序标记有时很烦人.除非您保存文件,否则 Visual Studio 不会更改文件(如 Hans 所说).

BOM or Byte Order Mark is sometimes quite annoying. Visual Studio does not change the file unless you save it (as Hans said).

这里是您问题的解决方案:如果要使用其他编码保存文件,请选择另存为并扩展文件对话框中的保存按钮,然后选择使用编码保存".或者,如果您想永久摆脱此设置,只需打开文件"菜单并选择高级保存选项"即可.在那里你应该选择没有签名的 UTF-8";(这也回答了你的最后一个问题:).是无签名的 UTF-8"与没有 BOM 相同.

And here is the solution to your problem: If you want to save a file with other encodings, select save as and extend the save button in file dialog and select "Save with encoding". Or if you want to get rid of this setting permanently, just open File menu and select "Advanced save options" and there you should select "UTF-8 without signature" (and that also answered your last question :). Yes "UTF-8 without signature" is same as without BOM.

这篇关于没有 BOM 的 UTF-8的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆