How to fix “Byte-Order Mark found in UTF-8 File” validation warning

后端 未结 5 2100
旧时难觅i
旧时难觅i 2020-12-14 00:33

I\'ve got an xhtml page validating under xhtml strict doctype -- but, I getting this warning which I trying to understand -- and correct.

Just, how do I locate this e

5条回答
  •  [愿得一人]
    2020-12-14 00:49

    The location part of your question is easy: The byte-order mark (BOM) will be at the very beginning of the file.

    When editing the file, go to File | Advanced Save Options... and you should find an "Encoding" drop-down (along with a "Line endings" drop-down). It's probably set to use "Unicode (UTF-8 with signature) - Codepage 65001". If you scroll down a fair bit, you can find "Unicode (UTF-8 without signature) - Codepage 65001". That should do it (if you want to). Some systems may be confused by a BOM on a UTF-8 file, as the warning indicates.

    See also this note in the Unicode site's FAQ about the BOM and UTF-8 files. It has no function other than to call out that the file is, in fact, UTF-8. In particular, it has no effect on the byte order (the main reason we have BOMs), because the byte order of UTF-8 is fixed.

提交回复
热议问题