解码期间为何UnicodeEncodeError
?
我估计得到UnicodeDecodeError
。
>>> u'\udcc3'.decode('utf8')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/foo_x_d/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeEncodeError: 'ascii' codec can't encode character u'\udcc3' in position 0: ordinal not in range(128)