[issue47000] Make encoding="locale" uses locale encoding even in UTF-8 mode is enabled.

Marc-Andre Lemburg report at bugs.python.org
Wed Mar 30 05:40:35 EDT 2022


Marc-Andre Lemburg <mal at egenix.com> added the comment:

Please see https://bugs.python.org/issue47000#msg415769 for what Victor
suggested.

In particular, the locale module uses the "no underscore" convention.
Not sure whether it's good to start using snake case now, but I'm also
not against it.

I would like to reiterate my concern with the "locale" encoding, though.

As mentioned earlier, I believe it adds too much magic. It would be better
to leave this in the hands of the applications and not try to guess
the correct encoding.

It's better to expose easy to use APIs to access the various different
settings and point users to those rather than try to do a best effort
guess... explicit is better than implicit.

After all, Mojibake potentially corrupts important data, without the
alerting the user and that's not really what we should be after (e.g.
UTF-8 is valid Latin-1 in most cases and this is a real problem we often
run into in Germany with our Umlauts).

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47000>
_______________________________________


More information about the Python-bugs-list mailing list