'gbk' codec can't decode byte 0xa1 in position 17: illegal multibyte sequence
时间: 2023-08-13 07:07:21 浏览: 103
invalid multibyte character sequence 870告警1
这个问题是由于使用'gbk'编解码器尝试解码一个非法的多字节序列引起的。 解决这个问题的方法是使用其他的编解码器,比如'utf-8'。 在你的代码中找到这一行:helloContent = helloFile.read(),并将编码器参数指定为'utf-8',例如:helloContent = helloFile.read().decode('utf-8')。这样可以解决编码解码错误。<em>1</em><em>2</em><em>3</em>
#### 引用[.reference_title]
- *1* *3* [Windows下‘gbk‘ codec can‘t decode byte 0xae问题出现的原因及解决方法](https://blog.csdn.net/mascotyak/article/details/109893793)[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]
- *2* [PyInstaller 打包exe出错 UnicodeDecodeError: 'gbk' codec can't decode byte 0xa1 in position](https://blog.csdn.net/weixin_42426496/article/details/81102665)[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]
[ .reference_list ]
阅读全文