asp.net mvc-修复文件中BOM的编码..正在进行MVC项目



我正在使用Visual Studio 2012开发MVC网站。

当我在W3C中验证该网站时,我会收到一条警告:

Byte-Order Mark found in UTF-8 File.
The Unicode Byte-Order Mark (BOM) in UTF-8 encoded files is known to cause problems for some text editors and older browsers. You may want to consider avoiding its use until it is better supported. 

我使用Notepad++将编码从UTF-8更改为不带BOM的UTF-8。

在这种情况下,网页中的一些字符(á,ç,à,…)以一种奇怪的方式显示。。。

我该怎么解决这个问题?

谢谢,Miguel

我通常不会太担心这个警告。

但如果你愿意,你可以在文件中添加一个元标记,也可以在visualstudio中进行转换。

<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>

以下是一个关于如何在visual studio中无BOM保存的so线程:UTF-8不带BOM

相关内容

最新更新