用EditPlus 清除UTF-8 文件的BOM

November 18th, 2008
Goto comments 340 views

使用W3C Validator 工具验证XHTML 的时候,出现:

The following missing or conflicting information caused the validator to perform guesswork prior to validation. If the guess or fallback is incorrect, it may make validation results entirely incoherent. It is highly recommended to check these potential issues, and, if necessary, fix them and re-validate the document.

Byte-Order Mark found in UTF-8 File.

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.

原因是因为在本地用记事本修改过WordPress主题,如果以UTF-8编码保存文件,再用UE打开,切换到十六进制编辑状态可以看到文件开头多了FFFE。

其实可以使用EditPlus 将UTF-8 文件的BOM清除掉,打开EditPlus -> 工具 -> 配置用户工具 -> 文件,默认编码方式选择:UTF-8,UTF-8 标识选择:总是删除签名,最后保存参数设置。如图:

 

如此,UTF-8 文件中令人讨厌的BOM 就可以被清除掉,再次使用W3C Validator 校检的话,就不会出现Byte-Order Mark found in UTF-8 File.

博客心得 , ,

  1. haphic
    November 19th, 2008 at 14:06 | #1

    呵, 长了点见识, 不错的小手段.

  2. November 22nd, 2008 at 17:57 | #2

    原来记事本也能留尾巴的呀

  1. No trackbacks yet.