原文:python 3.0讀取文件出現編碼錯誤(illegal multibyte sequence )

代碼如下: myfile open e: enterprise.xlsx ,mode r file content myfile .readlines print file content 執行時報錯信息如下:illegal multibyte sequence 嘗試解決方式一:添加編碼方式:gb ,失敗 myfile open e: enterprise.xlsx ,encoding gb , ...

2019-01-28 14:17 0 5152 推薦指數:

查看詳情

illegal multibyte sequence python3

錯誤信息如下: 解決辦法: 因為decode的函數原型是decode([encoding], [errors='strict']),可以用第二個參數控制錯誤處理的策略,默認的參數就是strict,代表遇到非法字符時拋出異常; 如果設置 ...

Fri Jul 28 23:25:00 CST 2017 0 6843
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM