Thursday, 15 July 2010

unicode - JSON and escaping characters -


I have a string that JSON is serialized in JavaScript, and then deserialized for Java.

It seems that the string is a symbol of a degree, then I get a problem.

I can help with knowing who is guilty:

  • Is this the Spiderman 1.8 implementation?
  • Is not it something to do properly?

Here's what happens in JSD:

  js> s = '15 \ u00f8C '15 degree celsius; JSON Stringive (S) "15 ° C"  

I happens "15 \ u00f8C" Which makes me believe that the SpyMoK's JSON implementation is the right thing to do Not doing ... except that (what this device is) says that a cell can be

except for any unicode-character - "- or - \ - or -Control-character "

It may be that with string - this is the encoding \ u00f8 ... in that case I would think that the problem is with the GSO library.

Can anyone help?

I think my job is to either use a different JSON library, or manually avoid the string after calling JSON.stringify () - but if If this is a bug then I would like to file a bug report.

This implementation is not a bug either, there is no need to avoid U + 00B To quote:

2.5 strings

The representation of the string is similar to the conventions used in the C family of programming languages. A string starts and ends with quotation marks.

Any letter

Avoiding everything increases the size of the data (all the code points displayed in four or less bytes in all Unicode conversion formats Can be made; they make six or twelve bytes.)

It is possible that a text transcoding bug in your code somewhere in the ASCII subset mask Avoid Msya. This is a requirement of JSON device that all data uses Unicode encoding.


No comments:

Post a Comment