简体   繁体   中英

Setting Charset for static files in iis

How can I ensure IIS (and Cassini) send css and js files with the content-type header (ie text/css;charset=UTF-8)?

Having just come up with the same question I found the answer here (for IIS7/7.5, but expect this should also work for Casini):

Either:

  • Directly add the ; charset=utf-8 ; charset=utf-8 to the mime type in the mine types configuration in IIS manager.
  • Edit the web.config:
  <configuration>
    <system.webServer>
      <staticContent>
        <mimeMap fileExtension=".rss" mimeType="text/xml; charset=utf-8"/>
      </staticContent>
    [...]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM