使用IIS 7强制编码

我尝试用IIS 7强制编码

当我在http响应头中添encryption钥时:

内容types和值字符集= utf-8我得到这个关键的内容types:文本/ HTML,内容types= utf-8

有没有办法删除逗号?

谢谢贾斯汀你的答案。

但是看起来不行。 有我的configuration,我需要为asp经典做。

<?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <staticContent> <remove fileExtension=".html" /> <remove fileExtension=".hxt" /> <remove fileExtension=".htm" /> <remove fileExtension=".asp" /> <mimeMap fileExtension=".htm" mimeType="text/html" /> <mimeMap fileExtension=".hxt" mimeType="text/html" /> <mimeMap fileExtension=".html" mimeType="text/html" /> <mimeMap fileExtension=".asp" mimeType="text/html; charset=UTF-8" /> </staticContent> </system.webServer> </configuration> 

    您可以在web.config文件中为需要此function的每个网站手动设置特定文件扩展名的内容types。 在站点的根目录下,findweb.config文件,并添加如下的removemimeMap行(或者如果整个文件不存在,则创build整个文件)。

     <?xml version="1.0" encoding="UTF-8"?> <configuration> <system.webServer> <staticContent> <remove fileExtension=".html" /> <mimeMap fileExtension=".html" mimeType="text/html; charset=UTF-8" /> </staticContent> </system.webServer> </configuration> 

    来自讨论这个问题的IIS论坛的样本。