4 ms·
JSON is a text format, not binary http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf http://www.ecma-international.org/publications/files
by d0mine 10y ago
JSON is a text format, not binary http://www.ecma-international.org/publications/files/ECMA-ST/ECMA-404.pdf http://www.ecma-international.org/publications/files/ECMA-ST...
JSON text is a sequence of Unicode code points, not bytes. Python 3 str type is ideal to represent JSON text.
On the internet "JSON text SHALL be encoded in UTF-8, UTF-16, or UTF-32" https://tools.ietf.org/html/rfc7159 https://tools.ietf.org/html/rfc7159
json.loads() accepts binary input on Python 3.6. using the encoding detection scheme from the obsolete rfc 4627 that relies on now false assumptions (that json text represents either array or object).