本文介绍了utf8'编解码器无法解码位置中的字节0xae的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我刚刚发现我的json字符串包含一些特殊字符,例如Pandora ®
.当我使用此错误时,我得到此错误'utf8' codec can't decode byte 0xae in position: invalid start byte
:
I just found out that my json string contains some special characters such as Pandora®
.And I get this error 'utf8' codec can't decode byte 0xae in position: invalid start byte
when i use this:
json.loads(str_to_load)
我已尝试解决此问题:
json.loads(unicode(str_to_load), "ISO-8859-1")
显然,这似乎也不起作用.如何解决这个问题?
Apparently, this seems to not working either. How to fix this issue?
json文件太大,无法在此处上传.
The json file is too big to upload here.
推荐答案
您可以在 json.loads
:
json.loads(str_to_load, encoding="ISO-8859-1")
这篇关于utf8'编解码器无法解码位置中的字节0xae的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!