'utf-8' codec can't decode byte 0xcd in position 1324: invalid continuation byte
时间: 2023-08-28 11:21:00 浏览: 81
basemap readshapefile UnicodeDecodeError: 'utf-8' codec can't decode byte 0xb4 in position 0-附件资源
这个错误提示表明在解码过程中出现了无效的续字节。这通常是因为尝试用utf-8编解码一个包含非utf-8字符的字符串导致的。解决这个问题的一种方法是使用其他编码格式进行解码,如ISO-8859-1。你可以尝试用这种编码格式来解码字符串,看看能否解决问题。例如,你可以使用以下代码来解码数据:
data = resp.read().decode('ISO-8859-1')
这样,你就使用ISO-8859-1编码格式来解码数据,而不是默认的utf-8编码格式。希望这能帮到你解决问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [UnicodeDecodeError: 'utf-8' codec can't decode byte 0xcd in position 0: invalid continuation byte](https://blog.csdn.net/Twanggg/article/details/102451084)[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^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *2* [UnicodeDecodeError: ‘utf-8‘ codec can‘t decode byte 0xcd in position 149: invalid continuation ...](https://blog.csdn.net/CP1024/article/details/118345200)[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^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文