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