"I don't know why this is happening"
Well I have just run into a possible cause:-) Your HTML page is being assembled
from separate files. Perhaps you have files which only contain the body or banner portion of your final page. Those files contain a BOM (0xFEFF) marker. Then as part of the merge process you are running HTML tidy or xmllint over the final merged HTML file.
That will cause it!