why this is wrong?

bruce.who.hk bruce.who.hk at gmail.com
Mon Oct 9 06:41:00 EDT 2006


Hi, all

I just donnot know why this is wrong, you can test it in python shell:

class B:
    def __str__(self):
        return u'\u5929\u4e0b'
    
b=B()
str(b)
Traceback (most recent call last):
  File "<input>", line 1, in ?
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-1: ordinal not in range(128)

Could anybody point me out?
 				
--------------
bruce.who.hk
2006-10-09




More information about the Python-list mailing list