On 01/09/2014 02:00 PM, Chris Barker wrote:
On Thu, Jan 9, 2014 at 1:45 PM, Antoine Pitrou wrote:
Chris Barker wrote:

latin-1 guaranteed to work with any binary data, and round-trip accurately?

Yes, it is.

and will surrogateescape work for arbitrary binary data?

Yes, it will.

Then maybe this is really a documentation issue, after all.

I know I learned something.

If latin1 is used to convert binary to text, how convoluted is it to then take chunks of that text and convert to int, or some other variety of unicode?

For example:  b'\x01\x00\xd1\x80\xd1\83\xd0\x80'

If that were decoded using latin1 how would I then get the first two bytes to the integer 256 and the last six bytes to their Cyrillic meaning? (Apologies for not testing myself, short on time.)

--
~Ethan~
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to