I am using json with unicode text and I had a problem with json based 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 native json FireFox, the alert() is the same as the original. IE8, on the other hand, returns Unicode values, not the original text \u0e2a\u0e27\u0e31\u0e2a\u0e14\u0e35 ol\u00e9 . Is there an easy way to get IE to behave like the others or to convert this string to how it should be? And do you think this is a mistake in IE, I thought that for the implementation of json2.js similar replacements should be used for native json?
Edit: play on jsfiddle using the above code - http://jsfiddle.net/vV4uz/
json javascript internet-explorer encoding unicode
mikel
source share