0

厳密な XHTML に対して有効で、検証に合格した Web サイトを作成しましたが、W3C バリデーターから次のメモ (エラー) があると通知されました。

UTF-8 ファイルにバイト オーダー マークが見つかりました。

UTF-8 でエンコードされたファイルの Unicode Byte-Order Mark (BOM) は、一部のテキスト エディターや古いブラウザーで問題を引き起こすことが知られています。サポートが改善されるまで、その使用を避けることを検討することをお勧めします。

しかし、私のファイルには BOM がありません。これは、VS で作成された単純な XHTML です。

サーバーはそれを追加していますか?どうすればエラーを取り除くことができますか?

これは、セマンティック抽出を台無しにするので重要です。http://www.w3.org/2003/12/semantic-extractor.html

4

2 に答える 2

2

リソースに BOM (EF BB BF) があります。おそらく、16進エディタを使用して削除することを検討してください。xml ファイルから BOM 文字を削除するにはどうすればよいですか

于 2012-06-19T14:58:30.387 に答える
1

W3C Markup Validator は、UTF-8 の BOM をエラーとして示しません。BOM は UTF-8 データの先頭で許可されているため、そうすると、それ自体がエラーになります。警告を発します。

The warning is seriously outdated. No problems have been observed in relevant browsers for many years. On the contrary, BOM should be regarded as useful, since if e.g. a file is saved locally (and HTTP headers are thus lost, the BOM in UTF-8 format lets browsers to infer, with practical certainty, that the document is UTF-8 encoded.

The Semantic data extraction tool is not very up-to-date, and it suffers from a too theoretic approach, but it does not seem to have any problem with BOM at the start of UTF-8 data.

It is possible that the server adds the BOM, or that your authoring tool adds it. Either way, it should be considered as useful, rather than a problem.

于 2012-06-19T17:38:14.743 に答える