Adding “charset” to all ASP.NET MVC HTTP responses
问题 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. 回答1: Maybe this in your web.config will do the magic? <configuration>