Is there an easy way to specify all "normal" views is an ASP.NET MVC app are to have charset=utf-8
appended to the Content-Type
? View()
lacks an override that allows you to specify the Content-Type
, and ActionResult
and friends don't seem to expose anything, either. The motivation is obviously to work around Internet Explorer guessing the "correct" encoding type, which I in turn want to do to avoid UTF-7 XSS attacks.
Maybe this in your web.config will do the magic?
<configuration>
<system.web>
<globalization requestEncoding="utf-8" responseEncoding="utf-8" />
</system.web>
</configuration>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With