WTF? Printing unicode strings

John Salerno johnjsal at NOSPAMgmail.com
Thu May 18 23:29:37 CEST 2006


Ron Garret wrote:
>>>> u'\xbd'
> u'\xbd'
>>>> print _
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
> UnicodeEncodeError: 'ascii' codec can't encode character u'\xbd' in 
> position 0: ordinal not in range(128)

Not sure if this really helps you, but:

 >>> u'\xbd'
u'\xbd'
 >>> print _
½
 >>>



More information about the Python-list mailing list