首页 > 解决方案 > Json UnicodeEncodeError for requests response

问题描述

I get this error: UnicodeEncodeError: 'charmap' codec can't encode character '\u2082' in position 1088: character maps to <undefined> when I try to load a request text to JSON in python 3.9, so my code is:

rq= requests.get(url)
rqJson= json.loads(rq.text)
print(rqJson)

I'm using Windows 10 and sys.stdout.encoding is utf-8

any help with this please?

标签: pythonencodingterminal

解决方案


推荐阅读