UnicodeDecodeError: 'gbk' codec can't decode byte 0xaa in position 12: illegal multibyte sequence
时间: 2023-10-22 10:26:18 浏览: 266
关于GBK和Unicode字符集转换乱码问题
3星 · 编辑精心推荐
这个错误表示在使用'gbk'编解码器时遇到了非法多字节序列的字节。该错误通常发生在尝试将非'gbk'编码的数据解码为'gbk'编码时。解决这个问题的方法是将编码器设置为正确的编码方式,例如'utf-8'。例如,在使用open()函数打开文件时,您可以指定encoding='utf-8'来避免这个错误。通过这样的设置,您可以正确地解码包含非'gbk'编码的文件。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [关于UnicodeDecodeError: 'gbk' codec can't decode byte的解决办法](https://blog.csdn.net/qq_29592829/article/details/71598664)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *2* [pyquery报错:UnicodeDecodeError: ‘gbk’ codec can’t decode byte](https://download.csdn.net/download/weixin_38665944/13751270)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
- *3* [UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xaa in position 8: illegal multibyte sequence](https://blog.csdn.net/weixin_44025103/article/details/124483122)[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^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 33.333333333333336%"]
[ .reference_list ]
阅读全文