Python utf-8使用tweepy从twitter名称打印/xe2/x9d,我如何解决这个问题?

Python utf-8使用tweepy从twitter名称打印/xe2/x9d,我如何解决这个问题?,python,twitter,utf-8,tweepy,codepages,Python,Twitter,Utf 8,Tweepy,Codepages,这是剧本 auth = tweepy.OAuthHandler() auth.set_access_token() api = tweepy.API(auth) for friend in tweepy.Cursor(api.friends, count = 200).items(): print(friend.name.encode('utf-8') 我所要做的就是用tweepy打印twitter关注者的名字,它打印出的最多,但我收到的一些“/xe4/x9d” 我尝试过使用不同的

这是剧本

auth = tweepy.OAuthHandler()
auth.set_access_token()

api = tweepy.API(auth)

for friend in tweepy.Cursor(api.friends, count = 200).items():
    print(friend.name.encode('utf-8')
我所要做的就是用tweepy打印twitter关注者的名字,它打印出的最多,但我收到的一些“/xe4/x9d”
我尝试过使用不同的代码页,但似乎都不起作用。我还使用Pydev for Eclipse作为IDE,我故意将auth和auth.set留空,请告诉我这是否可以修复,以显示twitter追随者的正确名称
print()
在Python 3中使用字符串;不要将其参数编码为字节
print(friend.name)
谢谢@Ryan,但随后我收到此错误返回codecs.charmap\u encode(输入,self.errors,encoding\u表)[0]UnicodeEncodeError:“charmap”编解码器无法对位置14中的字符“\u2757”进行编码:如果使用
PYTHONIOENCODING=utf-8 python…
(并且没有
encode
)运行脚本,它是否会产生乱码输出?