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
Post a Comment