<p dir="ltr"><br>
On 9 Jan 2014 22:25, "Kristján Valur Jónsson" <<a href="mailto:kristjan@ccpgames.com">kristjan@ccpgames.com</a>> wrote:<br>
><br>
><br>
><br>
> > -----Original Message-----<br>
> > From: Victor Stinner [mailto:<a href="mailto:victor.stinner@gmail.com">victor.stinner@gmail.com</a>]<br>
> > Sent: 9. janúar 2014 13:51<br>
> > To: Kristján Valur Jónsson<br>
> > Cc: Antoine Pitrou; <a href="mailto:python-dev@python.org">python-dev@python.org</a><br>
> > Subject: Re: [Python-Dev] Python3 "complexity"<br>
> ><br>
> > 2014/1/9 Kristján Valur Jónsson <<a href="mailto:kristjan@ccpgames.com">kristjan@ccpgames.com</a>>:<br>
> > > This definition is funny, because according to Wikipedia, it is a<br>
> > > "superset" of 8869-1 ( latin1)<br>
> ><br>
> > Bytes 0x80..0x9f are unassigned in ISO/CEI 8859-1... but are assigned in<br>
> > (IANA's) ISO-8859-1.<br>
> ><br>
> > Python implements the latter, ISO-8859-1.<br>
> ><br>
> > Wikipedia says "This encoding is a superset of ISO 8859-1, but differs from<br>
> > the IANA's ISO-8859-1".<br>
> ><br>
><br>
> Thanks.  That's entirely non-confusing :)<br>
> " ISO-8859-1 is the IANA preferred name for this standard when supplemented with the C0 and C1 control codes from ISO/IEC 6429."<br>
><br>
> So anyway, yes, Python's "latin1" encoding does cover the entire 256 range.  But on windows we use cp1252 instead which does not,<br>
> but instead defines useful and common windows characters in many of the control caracters slots.<br>
> Hence the need for "surrogateescape" to be able to roundtrip characters.<br>
><br>
> Again, this is non-obvious, and knowing from my experience with cp1252, I had no way of guessing that the "subset", i.e. latin1, would indeed cover all the range.  Two things then I have learned since my initial foray into parsing ascii files with python3:  Surrogateescapes and "latin1 in python == IANA's ISO-8859-1 which does indeed define the whole 8 bit range".<br>
</p>
<p dir="ltr"><a href="http://python-notes.curiousefficiency.org/en/latest/python3/text_file_processing.html">http://python-notes.curiousefficiency.org/en/latest/python3/text_file_processing.html</a> is currently linked from the Unicode HOWTO. However, I'd be happy to offer it for direct inclusion to help make it more discoverable.</p>

<p dir="ltr">Cheers,<br>
Nick.</p>
<p dir="ltr">><br>
> K<br>
> _______________________________________________<br>
> Python-Dev mailing list<br>
> <a href="mailto:Python-Dev@python.org">Python-Dev@python.org</a><br>
> <a href="https://mail.python.org/mailman/listinfo/python-dev">https://mail.python.org/mailman/listinfo/python-dev</a><br>
> Unsubscribe: <a href="https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com">https://mail.python.org/mailman/options/python-dev/ncoghlan%40gmail.com</a><br>
</p>