How to correct character encoding in IE8 native json ?
Posted
by mike_t2e
on Stack Overflow
See other posts from Stack Overflow
or by mike_t2e
Published on 2010-04-03T09:23:34Z
Indexed on
2010/04/03
9:33 UTC
Read the original article
Hit count: 208
I am using json with unicode text, and having a problem with the IE8 native json implementation.
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script>
var stringified = JSON.stringify("?????? olé");
alert(stringified);
</script>
Using json2.js or FireFox native json, the alert()
string is the same as in the original one. IE8 on the other hand returns Unicode values rather than the original text \u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35 ol\u00e9
. Is there an easy way to make IE behave like the others, or convert this string to how it should be ? And would you regard this as a bug in IE, I thought native json implementations were supposed to be drop-in identical replacements for json2.js ?
© Stack Overflow or respective owner