UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb2 in position 1: invalid start byte
时间: 2023-08-28 12:18:25 浏览: 112
这个错误通常是由于文件编码问题引起的。根据引用中的信息,可以尝试将文件的编码格式更改为ANSI。具体方法是先找到csv文件,然后右键点击选择“打开方式”然后选择记事本。在记事本中选择“文件-另存为”并将编码格式更改为ANSI,保存成功后再运行代码即可。这样应该就能解决UnicodeDecodeError的问题。另外,根据引用的信息,如果是从网页中获取数据,可能还需要对返回的数据进行解码,以确保正确处理压缩的数据。<span class="em">1</span><span class="em">2</span>
#### 引用[.reference_title]
- *1* [成功解决:UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xb1 in position 49:](https://blog.csdn.net/T752462536/article/details/119578911)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [UnicodeDecodeError: utf-8 codec can t decode byte 0x8b in position 1: invalid start byte](https://blog.csdn.net/m0_52613986/article/details/129739448)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文