Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I try to force encoding with IIS 7.

When I add in the http response headers the key :

Content-Type and value charset=utf-8 i got this key content-type : text/html,content-type=utf-8

it's there a way to remove the comma ?

Thanks Justin for your answer.

But it's seen don't work. There is my config, i need to do that for asp classic.

<?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>
share|improve this question
add comment

1 Answer 1

You can manually set the content type for specific file extensions in the web.config file for each web site where this is needed. In the root for the site, find the web.config file and add the remove and mimeMap lines as below (or create the entire file if it doesn't already exist).

<?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>

Sample taken from a discussion on the IIS Forums which addressed this question.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.