'gbk' codec can't decode byte 0xa2 in position 1252: illegal multibyte sequence
时间: 2023-08-12 19:09:40 浏览: 80
在读取gbk格式的数据时,如果出现报错信息 'gbk' codec can't decode byte 0xa4 in position 16433: illegal multibyte sequence,这可能是由于数据中包含了其他特殊字符导致的。类似的问题也可能在读取yaml文件时出现,报错信息为UnicodeDecodeError: 'gbk' codec can't decode byte 0xa7 in position 265: illegal multibyte sequence。解决这个问题的方法是将数据的编码格式进行调整。根据引用\[3\]中的描述,可以尝试将编码格式从gbk改为gb18030,这可能会解决问题。
#### 引用[.reference_title]
- *1* *3* [‘gbk‘ codec can‘t decode byte 0xa4 in position 16433: illegal multibyte sequence](https://blog.csdn.net/ddliyoutang/article/details/124471148)[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^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
- *2* [UnicodeDecodeError: ‘gbk‘ codec can‘t decode byte 0xa7 in position 265: illegal multibyte sequence](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^v91^control,239^v3^insert_chatgpt"}} ] [.reference_item]
[ .reference_list ]
阅读全文