There is no means to globally specify the CharSet
for an application.
There is actually more to it than just telling the client its getting UTF-8. You also need to ensure the response object is configured to the 65001 codepage. This at least can be set globally using the AspCodePage
metabase value at the application level (or directly in the ASP feature in IIS7 manager).
However my preference with this sort of thing is to avoid depending on the server to be configured correctly. Each page sets its codepage (either with the @CODEPAGE
directive or with Response.Codepage
) and its CharSet
.
I have two reasons for this approach. One is that ultimately the CharSet/Codepage is choice made at the time of creating and saving the file. The other is that when depolying/copying the site the less you have to remember to configure the better.
CharSet
globally for an ASP.NET application, this is possible. See the<globalization>
element in Web.config. Also, in ASP.NET,CodePage
65001 is the default. (CodePage
governs how the ASP.NET source code is processed on the server.CharSet
governs what character encoding (e.g. UTF-8) is returned to the client.) – Nela