使用csv.reader(file)读csv文件时,出现如下错误: UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xd0 in position 0: invalid continuation byte 出现原因:文件不是 UTF8 编码的,而系统默认采用 UTF8 解码。解决方法是改为对应的解码方式。
解决办法: 找到csv文件–》右键–》打开方式–》记事本 打开记事本之后,选择头部菜单的“文件–》另存为”,可以看到文件的默认编码格式为ANSI
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有