UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb5 in position 3: invalid start byte
时间: 2023-08-14 11:02:39 浏览: 143
python解决汉字编码问题:Unicode Decode Error
这个报错通常是在使用utf-8编码方式读取文件或解码字符串时遇到无法解码的字符引起的。一种解决方法是在读取文件或解码字符串时增加忽略错误的设置,避免报错。例如,在打开文件时可以使用参数errors='ignore'来忽略解码错误。另一种方法是将编码方式从'utf-8'或'gbk'改为'ISO-8859-1',这种编码方式可以解决一些无法解码的字符问题。在处理这种情况时,可以考虑对返回的数据进行解压缩操作,然后再进行解码处理。<span class="em">1</span><span class="em">2</span>
#### 引用[.reference_title]
- *1* [遇到UnicodeDecodeError: ‘utf-8’ codec can’t decode byte 0xa3 in position 4: invalid start byte的...](https://blog.csdn.net/phoenix339/article/details/122958871)[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 ]
阅读全文