months = ["Januar", "Februar", "März", "April", "Mai", "Juni", "Juli", "August", "September", "Oktober", "November", "Dezember"]
print months[2].decode("utf-8")
打印月[2]失败
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1-2: invalid data
帮我摆脱这个!
在源文件的开头添加了编码吗?
你确定你在用UTF8工作吗?
尽管如此,我还是建议定义
如果你做一些基于字节的事情,你就可以把数据放入你需要的字符集中。
相关问题 更多 >
编程相关推荐