原文: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