On 2006-10-19, Michael Ströder <michael at stroeder.com> wrote:
>NoelByron at gmx.net wrote:
>>>> print 'K\xc3\xb6ni'.decode('utf-8')
>>>> and this line raised a UnicodeDecode exception.
>> Works for me.
>> Note that 'K\xc3\xb6ni'.decode('utf-8') returns a Unicode
> object. With print this is implicitly converted to string. The
> char set used depends on your console
No, the setting of the console encoding (sys.stdout.encoding) is
ignored. It's a good thing, too, since it's pretty flaky. It uses
sys.getdefaultencoding(), which is always 'ascii' as far as I
know.
--
Neil Cerutti