验证错误:在UTF-8文件中找到的字节顺序标记

Car*_*rlo 7 html byte-order-mark utf-8 w3c-validation

我正在一个网站上工作,虽然在Firefox上显示它很好,在IE上我遇到了很多问题.我使用了w3c验证器,我遇到了很多奇怪的错误.

这是该网站的链接:http://misenplacecatering.it/

我认为最相关的第一个验证错误是:

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. 
Run Code Online (Sandbox Code Playgroud)

Line 1, Column 1: Non-space characters found without seeing a doctype first. Expected <!DOCTYPE html>.
Run Code Online (Sandbox Code Playgroud)

我已经阅读了有关此问题的其他主题,因此我尝试使用不同的编辑器打开该文件(无论如何我总是使用Vim),但在doctype定义之前我没有看到任何空格或任何其他内容.我甚至使用notepad ++并使用了一个选项来删除bom,但没有.

有什么建议?

无论如何,

Ein*_*cio 11

如果使用notepad ++,请使用转换为UTF-8而不使用BOM.

如果你使用的是php,请确保所有包含/所需的文件都在ascii或UTF中没有BOM,因为php不能非常好地处理非ascii文件(这个让我头疼一次)

如果您不需要utf字符,可以尝试将文件转换为ascii

在<meta charset>上尝试在引号内写入值

  • 很高兴它帮助了.我曾经在第三级有这个问题包括,我不会忘记它 (3认同)