I have the following problem:
<script type="text/javascript">
alert("1. ČĆŽŠĐčćžšđ");
</script>
<script type="text/javascript" src="Tst.js"></script>
<script type="text/javascript">
var pScript = document.createElement("script");
pScript.type = "text/javascript";
pScript.src = "Tst.js";
pScript.charset = "windows-1250";
$("body").append(pScript);
</script>
(These are Croatian characters.)
Contents of Tst.js is:
alert("2. ČĆŽŠĐčćžšđ");
Output of this script in FireFox (and Safari, so I've concluded that this is not the problem with the browser, but my code):
1. ČĆŽŠĐčćžšđ
2. ČĆŽŠĐčćžšđ
2. �Ǝ���枚�
Charset on the main page that is calling this code is windows-1250.
I don't understand why when I call Tst.js statically (by <script src="Tst.js" type="text/javascript"></scipt>
) the characters are shown normal, but when I dinamically include Tst.js the characters go bannanas...
And unfortunately I can't port all my code to UTF-8 :(
Please help, I have cookies :)