不带BOM的UTF-8 [英] UTF-8 without BOM

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

问题描述

我有一些需要将它们保存为UTF-8(没有BOM)的javascript文件,每次我将它们转换为 Notepad ++ 的正确格式时,它们都会恢复为UTF-8我在Visual Studio中打开BOM时使用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不会更改文件(如汉斯所说).

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 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天全站免登陆