UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb8 in position 72: invalid start byte
时间: 2023-08-28 12:18:18 浏览: 140
U8读取数据源出现未知错误
这个错误的原因是在代码中尝试使用utf-8解码时遇到了一个无效的起始字节0xb8导致的。问题的解决方法是在解码函数中添加参数`encoding='utf8', errors='ignore'`来忽略无效的字节。具体来说,你可以将代码中的`decode()`函数修改为`decode(encoding='utf8', errors='ignore')`,这样就可以避免UnicodeDecodeError错误的发生。<span class="em">1</span><span class="em">2</span>
#### 引用[.reference_title]
- *1* [Anaconda UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xb4 in position 0: invalid start ...](https://blog.csdn.net/weixin_53366150/article/details/125845711)[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^chatsearchT0_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^chatsearchT0_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文