I'm updating another guy's website. He included the <title> tags in an include. So that I could optimize head tags, I copied and pasted the whole include where he had written
<?php include "incl_top.php"; ?>
Now on the page I get these characters:
I found a search result that says this is called a BOM or byte order mark. It says to stop this, make sure to save files using UTF-8 with the BOM turned off. But there are no UTF-8 files in the include.
The doctype is strict. I get the same issue in IE8 with compatibility view both off and on. Same issue seen in Foxfire.
Some text editors preserve BOM when they see it in the file, although they might hide it from you while editing.
Try opening the file with some editor (for example Geany from geany.org) which is aware of the actual bytes used and allows you to remove them. Geany has an option "write Unicode BOM" in the document menu. Just uncheck that checkbox and save th file.
Msg#: 4294994 posted 11:13 am on Apr 13, 2011 (gmt 0)
If the file has only regular 7-bit ASCII characters in it (which is common), it is also legal UTF-8. An editor might have saved the file with the BOM at the top.
Notepad++ is another editor (for Windows) that can save the file without the BOM.
In one editor (unfortunately don't recall which), I discovered I could remove the BOM by putting the cursor at the very top of the file and hitting Backspace. Nothing visibly happened, but it got rid of the BOM.
A "hexdump" utility can show you the actual bytes in the file. It's "hexdump" or "hd" in Linux. Somewhere, there should be an equivalent utility available for Windows.
I apologize for my delay in following through on this. A separate project deadline has come up.
But I've downloaded Notepad++ and have saved the files using ENCODING > SAVE TO UTF-8 WITHOUT BOM. I'll test them.
I never knew a problem such as this could exist. I'm going to have to rethink my naive use of regular Notepad for saving files. (Already got caught saving an XML spreadsheet in ASCII instead of the UTF-8 option).