On 9 January 2014 22:00, Chris Barker <chris.bar...@noaa.gov> wrote: > On Thu, Jan 9, 2014 at 1:45 PM, Antoine Pitrou <solip...@pitrou.net> 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.
Certainly, the idea that you can use the latin1 codec and you'll get the same sort of "ascii works and you can safely ignore the rest"[1] behaviour that you get in Python 2 is not well promoted, and is non-obvious. Paul [1] Where "safely" means "probably not as safely as you think, but I'll try not to nag you" :-) And of course you have to make sure you don't *add* any content that uses unicode characters beyond 255, or you get encoding errors. But you weren't going to do that, were you? _______________________________________________ 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