|
|
Subscribe / Log in / New account

Python 2.8?

Python 2.8?

Posted Jan 14, 2017 0:20 UTC (Sat) by vstinner (subscriber, #42675)
In reply to: Python 2.8? by epa
Parent article: Python 2.8?

I am working on a the new PEP 540 which would basically avoid almost all common encoding errors by default when using the POSIX locale or when my new UTF-8 mode is enabled explicitly. In this mode, mojibake is preferred over hard failure.
https://www.python.org/dev/peps/pep-0540/

It should be at least as good Python 2 "I don't care of encodings". IMHO it's even better since even if you can get mojibake, in most cases, you will get perfectly valid Unicode and so will benefit of advanced Unicode features to handle any languages and not just english in ASCII.

My hope is that the UTF-8 mode would give you the best of the two worlds (Python 2 bytes, Python 3 Unicode).


to post comments

Python 2.8?

Posted Jan 14, 2017 9:15 UTC (Sat) by rghetta (subscriber, #39444) [Link]

It seems a very welcomed improvement, thank you. But please make it the default in any condition, not only with a posix locale. I could have an utf-8 locale but still need to handle legacy files.


Copyright © 2025, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds