【发布时间】:2014-02-02 13:14:00
【问题描述】:
我尝试打印一个 PyQt4.QtCore.QString 对象:
print str(type(html))
print str(html)
但是,我收到以下错误:
<class 'PyQt4.QtCore.QString'>
Traceback (most recent call last):
File "download.py", line 23, in <module>
print str(html)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2039' in position 4165: ordinal not in range(128)
这里出了什么问题?
【问题讨论】:
标签: python qstring python-unicode