How to handle JSON encoding -


i believe valid json not contain encoding information (as opposed xml, instance). correct ? have "standard" encoding (e.g. utf-8) ? how supposed handle json encoding ?

from json rfc, section 3:

3. encoding

json text shall encoded in unicode. default encoding utf-8.

since first 2 characters of json text ascii characters [rfc0020], possible determine whether octet stream utf-8, utf-16 (be or le), or utf-32 (be or le) looking @ pattern of nulls in first 4 octets.

      00 00 00 xx  utf-32be       00 xx 00 xx  utf-16be       xx 00 00 00  utf-32le       xx 00 xx 00  utf-16le       xx xx xx xx  utf-8 

Comments

Popular posts from this blog

android - Get AccessToken using signpost OAuth without opening a browser (Two legged Oauth) -

org.mockito.exceptions.misusing.InvalidUseOfMatchersException: mockito -

google shop client API returns 400 bad request error while adding an item -