【发布时间】:2015-07-16 19:19:06
【问题描述】:
我正在学习 python 3 中的教程,但我正在使用 python 2.7,如何为 python 2.7 解码 utf-8?
使用的代码是:
data = data.readall().decode("utf-8")
但我得到一个 AttributeError:
AttributeError: addinfourl instance has no attribute 'readall'
【问题讨论】:
-
你的错误与encoding完全无关,你想用
readall()实现什么数据类型?
标签: python-2.7 python-3.x utf8-decode