I like Unicode more than I used to...

gabor gabor at z10n.net
Mon Feb 24 06:10:04 EST 2003


On Thu, 2003-02-20 at 06:06, Terry Hancock wrote:
> But why doesn't this work:
> >>> print u'\u4378'
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> UnicodeError: ASCII encoding error: ordinal not in range(128)
> >>> 
> 
> This does (I did a little poking around the docs after the above):
> >>> print u"\u2122".encode('utf-8')
> ?
> 
> Hmm. Why do I need to do that? Is there no way to figure out how to print a 
> unicode string when I'm running in a unicode capable terminal?  Also, is 

is there a way to specify in python some kind of default-encoding? i
mean can i somehow tell him that when printing unicode strings, i always
want to use utf-8, so that .encode('utf-8') isn't necessary?

gabor






More information about the Python-list mailing list