Garbled characters when retrieving JSON format data containing Japanese in Python requests
When I added the following line, Japanese was displayed correctly ~
r.headers = {"Content-Type": "application/json; charset=utf-8"}
Like this ↓
r = requests.get(url)
r.headers = {"Content-Type": "application/json; charset=utf-8"}
datas = r.json()
print(datas)
Recommended Posts