I have this
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<appSettings>
<add key="ContentServer" value="true" />
</appSettings>
<connectionStrings />
<system.web>
<trace enabled="false" requestLimit="25" pageOutput="false" traceMode="SortByTime" localOnly="false" />
<customErrors mode="Off" />
<compilation debug="false" />
<authentication mode="Windows" />
</system.web>
</configuration>
How do I set the encoding to utf-8 for files sent to client. Actually There can be other types of files sent to clients like js,css,images. But I have aspx pages, that I want to set text/html; charset=utf-8" content-type to. How can I add this to this web.config code?
Thanks
You need to set the responseEncoding attribute of the globalization element.
<globalization
responseEncoding="utf-8"
/>
In context:
<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