PEP 263 comments

Martin v. Loewis martin at v.loewis.de
Sat Mar 2 03:25:38 EST 2002


bokr at oz.net (Bengt Richter) writes:

> Will the following work?
> 
>  >>> print u'\u0041'
>  A
>  >>> print u'\u221e'
> 
>  Traceback (most recent call last):
>    File "<stdin>", line 1, in ?
>  UnicodeError: ASCII encoding error: ordinal not in range(128)
>  >>>

With the patch to print Unicode to the Windows console, the
UnicodeError will be gone. Whether or not Lucida Unicode supports that
character, I cannot say.

> And if I redirect the output to a file, what will be in the file?

Since the isatty test fails, the system default encoding will be used.
Unless you've changed that, you'll get a UnicodeError again.

Regards,
Martin



More information about the Python-list mailing list