Putting Unicode characters in JSON
On Fri, Mar 23, 2018 at 4:35 PM, Steven D'Aprano
<steve+comp.lang.python at pearwood.info> wrote:
> On Fri, 23 Mar 2018 12:05:34 +1100, Chris Angelico wrote:
>> Latin-1 is not "arbitrary bytes". It is a very specific encoding that
>> cannot decode every possible byte value.
> Yes it can.
> py> blob = bytes(range(256))
> py> len(blob)
> py> blob[45:55]
> py> s = blob.decode('latin1')
> py> len(s)
> py> s[45:55]
That doesn't seem to be a strictly-correct Latin-1 decoder, then.
There are a number of unassigned byte values in ISO-8859-1.