UnicodeDecodeError: 'gbk' codec can't decode byte 0xa2 in position 99: illegal multibyte sequence
时间: 2023-10-18 11:32:11 浏览: 146
invalid multibyte character sequence 870告警1
当出现UnicodeDecodeError: 'gbk'编解码器无法解码字节0xa2的错误时,这通常是因为在读取文件时使用了错误的编码方式。 为了解决这个问题,您可以尝试在读取文件的相关代码中指定正确的编码方式,比如将encoding='UTF-8'添加到with open()语句中。 这样可以确保文件以正确的编码方式进行解码,从而避免出现解码错误。<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 ]
阅读全文