I have a blog(wordpress based). And try to validate by w3c validator one of my page. The first error is:
Line 1, Column 1: Non-space characters found without seeing a doctype first. Expected <!DOCTYPE html>.
<!DOCTYPE html><!-- HTML 5 -->
Also, DebugBar (http://www.my-debugbar.com/wiki/IETester/HomePage) agree and show two invisible chars before <!
when I open the same page from "HTML Check" tab inside this tool. BUT!!
<!DOCTYPE html><!-- HTML 5 -->
<!
.So, all things considered, why & where I get these "odd symbols" from?
I found the root of problem. The general rule is:
If any(absolutely any!) file that take part in construction of the code of final HTML-page(the one to be sended to client) has encoding with BOM - final HTML-page WILL BE UTF-8-BOM. That is: you whole site should NOT contain even 1 file with BOM.
In my case I have total 1.3K files that make up my site. Only 4 files was BOMed:
And I was forced to re-save every and all of these 4 files as "UFT-8 without BOM" to get rid of "Non-space characters" validation error. When I did this (re-save files) - error is gone.