How to set IIS website's default encoding? How to set IIS website's default encoding? asp.net asp.net

How to set IIS website's default encoding?


The content encoding is set in the Machine.config file when the .NET Framework is installed. You can edit this file which will affect the response encoding of all ASP.NET sites, or you can override it on a per-site basis using the <globalization> element in each site's Web.config file.

MSDN Link


You could try adding the header to the HTTP Response Headers list for that site. If none is specified, it will be delivered in whatever the user agent requests, which is likely why you're seeing the ISO-8859-1

"Properties" => "HTTP Headers" => "File Types..." => "New Type...". Put in the extension you want to map, separately for each extension; IIS users will probably want to map .htm, .html,... Then, for Content type, add "text/html;charset=utf-8" (without the quotes; substitute your desired charset for utf-8;

FROM: http://www.w3.org/International/O-HTTP-charset.en.php


On Windows Server 2019 you can set "Use Unicode UTF-8 for worldwide language support". At the moment of writing it's still in beta and I can't find any official documentation. Enabling will most likely do the job.

Control Panel -> Region -> TAB: Administrative -> BUTTON: Change System Locale

You will need to reboot the server after changing this setting.