Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm migrating a web system that now works on windows server 2003 IIS 6, to IIS 7.5 on windows 2008 server This system generates javascript files with accented characters in ANSI (Portuguese - Brazil). These javascripts shows for example alert messages. In IIS 6 I have no problem with that, but now using IIS 7.5 if those files are not in UTF-8, the accented characters do not appear correctly. Do we have any way to force these files, even in ANSI, to be processed by IIS 7.5 as UTF-8 ? Thank you ! Cheers Xcarpa

share|improve this question

I think the best solution is not to force IIS to deliver the files as UTF-8, but to force IIS to tell the world they are ANSI encoded. Otherwise, it would be necessary an ISAPI filter to perform on the fly conversion of the ANSI encoded files to UTF-8, which may cost a lot of CPU cycles, depending on the number of JavaScript files and the frequency they are accessed.

I recommend adjusting the MIME types configuration on IIS, to force JavaScript files to be delivered as ANSI. To do that, use IIS Manager, go to the server level, click on the MIME Types button, look for ".js" extension and add "; charset=Windows-1252" (without quotes) to the end of the MIME type definition. Again, don't replace the definition, just add the text between quotes and you should fix the problem.

share|improve this answer

As Jose pointed out, I would not let IIS convert these resources on the fly. Instead, you might want to convert the actual JavaScript files to UTF-8 with a text editor or a command line tool like recode.

share|improve this answer

Your Answer


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.