[Python-Dev] Unicode howto in the works - feedback appreciated
Wed, 1 May 2002 10:14:43 +0200
Gustavo Niemeyer wrote:
> I'm not sure if this is a common issue with other languages. But at
> least here (brazilian portuguese), this is a little bit inconvenient.
> Fortunately, fixing this is easy, since site.py was nicely prepared
> for this (thanks <author> ;-):
> if 0:
> # Enable to support locale aware default string encodings.
> import locale
> loc = locale.getdefaultlocale()
> if loc:
> encoding = loc
> Enabling it should be enough
that's a really great way to write non-portable code, of
please keep your encodings explicit.
(if you're printing lots of stuff, use an encoded stream)