Here is another work-around to setting stdout's encoding.

> import sys, codecs, locale
> 
> if sys.stdout.encoding is None:
>     (lang, enc) = locale.getdefaultlocale()
>     if enc is not None:
>         (e, d, sr, sw) = codecs.lookup(enc)
>         # sw will encode Unicode data to the locale-specific character set.
>         sys.stdout = sw(sys.stdout)

Found the missing tid-bit in the Marc-Andre Lemburg's tutorial,

> http://mail.python.org/pipermail/i18n-sig/2000-April/000066.html

-- 
Ilguiz



-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to