Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
688 views
in Technique[技术] by (71.8m points)

html - Validation error: Byte-Order Mark found in UTF-8 File

I'm working on a website and while displaying it on Firefox is fine, on IE I've got a lot of problems. I used the w3c validator and I got a lot of strange errors.

Here's the link to the website: http://misenplacecatering.it/

The first validation error, I think the most relevant, is this:

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. 

and

Line 1, Column 1: Non-space characters found without seeing a doctype first. Expected <!DOCTYPE html>.

I've read other threads about this issue so I tried to open the file with different editors (I always use Vim, anyway), but I don't see any space or anything else before the doctype definition. I even used notepad++ and used an option to remove bom, but nothing.

Any suggestions?

Anyway,

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

if using notepad++, use Convert to UTF-8 without BOM.

if you are using php, make sure that any included/required file is in either in ascii or UTF without BOM, as php doesn't handle non-ascii file very good (this one gave me a headache once)

you could try converting your files to ascii, if you don't need utf characters

on your <meta charset > try writing the value within quotes


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...