如果我想正确地将Unicode元素显示为字符串,我为什么要用英语?
我想你可以将每个项目逐个编码成utf-8,如果这就是你想要的。
list = [u"hi",u"Whatever",u"Hello"] map(lambda item: item.encode("utf-8"), list)
输出
['hi', 'Whatever', 'Hello']
有关the map function的更多详细信息,请参阅以下内容。如果这是一个选项,你也可以使用python3。