Is setdefaultencoding bad?

Chris Rebert clp2 at rebertia.com
Wed Feb 23 07:14:29 EST 2011


On Wed, Feb 23, 2011 at 3:07 AM, moerchendiser2k3
<googler.1.webmaster at spamgourmet.com> wrote:
> Ok, but that the interface handles UTF-8 strings
> are still ok? The defaultencoding is still ascii.

Yes, that's fine. UTF-8 is an excellent encoding choice, and
encoding/decoding should always be done explicitly in Python, so the
"default encoding" ideally ought to never come into play (and indeed,
Python 3 does away with bug-prone implicit encoding/decoding entirely
FWICT). Having ASCII as the "default encoding" ensures that implicit
encoding/decoding bugs are relatively apparent.

Cheers,
Chris
--
http://blog.rebertia.com



More information about the Python-list mailing list