views:

125

answers:

1

I would like to print a status message to my German users, which contains umlauts (ä/ü/ö). I also would like them be in the source file rather than having to download and parse some extra file just for the messages.

However, I can't seem to find a way to define the encoding of a JS source file. Is there something like HTML's http-equiv? Or should I define the encoding in the HTTP header?

When I simply encode the file in UTF-8 an serve it, IE displays garbage.

+2  A: 

Sending the encoding in the headers is always a good idea.

If that's not possible, the <script> tag has the charset property. W3C Reference

<script src="translations.js" type="text/javascript" charset="utf-8">
Pekka