I have a string that is serialized in JSON in Javascript and then deserialized in Java.
It looks like if the string contains a power symbol, then I get the problem.
I could use some help figuring out who is to blame:
- Is this an implementation of Spidermonkey 1.8? (this has a built-in JSON implementation)
- is it google gson ?
- Is it because I am not doing something right?
Here is what happens in JSDB:
js>s='15\u00f8C' 15Β°C js>JSON.stringify(s) "15Β°C"
I would expect "15\u00f8C' , which leads me to believe that the JSON implementation of Spidermonkey is not doing the right thing ... except that the syntax of the main JSON page description (is this a specification?) Says char could be
any-Unicode character- except - "- or - \ - or - control character"
so maybe it passes the string along as-is without encoding it as \ u00f8 ... in this case I would think that the problem is with the gson library.
Can anyone help?
I believe my workaround is to use either another JSON library or manually delete the lines after calling JSON.stringify() , but if this is an error, I would like to report an error.
json unicode
Jason S 04 Feb '11 at 17:39 2011-02-04 17:39
source share