[Python-3000] Pre-PEP: Easy Text File Decoding

Paul Moore p.f.moore at gmail.com
Mon Sep 11 23:49:34 CEST 2006


On 9/11/06, Michael Chermside <mcherm at mcherm.com> wrote:
> Paul Prescod writes:
>      [... Pre-PEP proposal ...]
>
> Quick thoughts:

My quick thoughts on this whole subject:

* Yes, it should be "open". Anything else feels like gratuitous breakage.
* There should be a default encoding, and it should be the system
default one. If I don't take special steps, most tools I use save in
the system default encoding, so Python should follow this approach as
well.
* I don't mind corrupted characters for unusual cases. Really, I don't.
* The bizarre Windows behavious of using different encodings for
console and GUI programs doesn't bother me either. Really. I promise.

99.99% of the time I simply don't care about i18n. All I want is
something that runs on the machine(s) I'm using. Using the system
locale is fine for that.

In the rare cases where I *do* care about international characters, I
have no problem doing work and research to get things right. And when
I've done that, detecting encodings and specifying the right thing in
an open() call is entirely OK.

Of course, I'm in the useful position of having an OS default
character set which contains ASCII as a subset. I don't know what
issues someone with Greek/Russian/Japanese or whatever as an OS
default would have (one thought - if your default character set
doesn't contain ASCII as a subset, how do you deal with the hosts
file? OTOH, I had a real struggle to find an example of an encoding
which didn't have ASCII as a subset!)

Paul.


More information about the Python-3000 mailing list