Characters with ASCII > 128 are not correctly read in Javascript
I have a HTML that includes a Javascript file. This script contains a special character, ASCII 152. When I try to display the charCodeAt, I get different results, but never the right one. Could you please advice? Thanks TEST.HTML <script type="text/javascript" charset=SEE BELOW src="test.js"> </script> TEST.JS file with ANSI encoding function d(a) { a=(a+"").split(""); alert(a[1].charCodeAt(0)); }; d("i˜g"); // Note that ˜ is 152 in ASCII TEST.HTML with x-user-defined charset: alert shows 63384. With %63232 works, as every char >128 is displayed as 63232+char. TEST.HTML with utf-8 charset: