Login

Problem with Byte Order Mark

Versions: n/a, FAQ number: 223,

Question

Why do I get a warning when validating a page with the W3C validator?


Answer

A byte order mark (BOM) is added to the response when the url-rewriter is active. This will generate a warning when validating the page with the W3C validator. The reason for the warning is that very old browsers may have a problem with the BOM, however any reasonably modern browser is able to handle it correctly.

If you experience this problem and wish to eliminate it, add the following to, for example, the OnLoad method in your master page:

HttpContext.Current.Response.ContentEncoding = new UTF8Encoding(false);
EPiTrace logger