原文:UnicodeDecodeError: 'gbk' codec can't decode byte 0xff in position 0: illegal multibyte sequence

混淆了 python 里边的 str 和 unicode 数据类型。 .对需要 str gt unicode 的代码,可以在前边写上import sysreload sys sys.setdefaultencoding utf 把 str 编码由 ascii 改为 utf 或 gb .python 区分了 unicode str 和 byte arrary,并且默认编码不再是 ascii ...

2013-08-02 14:45 0 20349 推荐指数:

查看详情

 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM