views:

48

answers:

2

I created a simple test page on my website www.xaisoft.com and it had no errors, but it came back with the following warning and I am not sure what it means.

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.

+1  A: 

Some text editors - notably Notepad - put an extra character at the front of the text file to indicate that it's Unicode and what byte-order it is in. You don't expect Notepad to do this sort of thing, and you don't see it when you edit with Notepad. You need to open the file and explicitly resave it as ANSI. If you're using fancy characters like smart quotes, trademark symbols, circle-r, or that sort of thing, don't. Use the HTML entities instead.

Aric TenEyck
I used notepadd++. Do I need to do the same thing?
Xaisoft
Possibly - also, note edited answer. I've never used Notepad++ before.Your best bet might be to open the file as binary (with Notepad++ or Visual Studio) and manually overwrite the first three bytes with spaces.
Aric TenEyck
I am not using any fancy characters, but notepad++ only allows me to save it as html which is what it is.
Xaisoft
Hmmm... Look in the save options and see if you can save as ANSI instead of Unicode, or turn off the BOM.
Aric TenEyck
Thanks, the other user pointed that out as well.
Xaisoft
+1  A: 

To find out what the BOM is, you can take a look at the Unicode FAQ (quoting) :

Q: What is a BOM?

A: A byte order mark (BOM) consists of the character code U+FEFF at the beginning of a data stream, where it can be used as a signature defining the byte order and encoding form, primarily of unmarked plaintext files. Under some higher level protocols, use of a BOM may be mandatory (or prohibited) in the Unicode data stream defined in that protocol.

Depending on your editor, you might find an option in the preferences to indicate it should save unicode documents without a BOM... or change editor ^^

Pascal MARTIN
Ok, Notepadd++ had an option to save the file without the BOM.
Xaisoft