Currently our pages are being output with the Unicode BOM.
I have found one way of removing this by adding the following to my masterpage's OnInit
.
Response.ContentEncoding = System.Text.UTF8Encoding(false);
Where the false
being passed to the UTF8Encoding
constructor disables the BOM.
This works fine, but I'd prefer to set this in the web.config rather than relying on it being in the OnInit
hierarchy of any given page.
The globalization
element has a responseEncoding
attribute which takes a string representation of a valid endcoding. e.g.
<globalization
responseEncoding="utf-8"
... />
Is there any way of representing "utf-8 without BOM" as a string which could be used as the value for responseEncoding
in the web.config?