UnicodeDecodeError: 'gbk' codec can't decode byte 0xa0 in position 1611: illegal multibyte sequence
时间: 2023-10-18 19:26:14 浏览: 165
关于GBK和Unicode字符集转换乱码问题
3星 · 编辑精心推荐
这个错误是由于在读取文件时使用的编码方式不正确导致的。通常情况下,UnicodeDecodeError: 'gbk' codec can't decode byte 0xa0 in position 1611: illegal multibyte sequence 的错误可以通过确保使用正确的编码方式来解决。根据引用中提供的解决办法,你可以在读取文件的代码中添加encoding='UTF-8'参数来指定使用UTF-8编码方式进行读取。这样应该就能够解决这个问题了。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [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: 50%"]
- *2* *3* [UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa7 in position 265: illegal multibyte ...](https://blog.csdn.net/qq_44368508/article/details/126831706)[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: 50%"]
[ .reference_list ]
阅读全文