[PYTHON] Display Japanese in JSON file

problem

Garbled characters when retrieving JSON format data containing Japanese in Python requests

solution

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

Display Japanese in JSON file
How to create a JSON file in Python
File operations in Python
File processing in Python
File operations in Python
Returns json in Pyramid
Japanese output in Python
English PDF in Japanese
Parse a JSON string written to a file in Python
Read the csv file and display it in the browser
Eliminate garbled Japanese characters in JSON data acquired by API.
Easily format JSON in Python
[Seaborn] Display Japanese (change font)
Download the file in Python
Display HTML in Jupyter notebook
Japanese display of matplotlib, seaborn
Display UTM-30LX data in Python
Parse JSON file to object
Select file in dialog with python → Display file name in message box
I understand Python in Japanese!
Get Japanese synonyms in Python
How to not escape Japanese when dealing with json in python
Count specific strings in a file
Export DB data in json format
File / folder path manipulation in Python
Write JSON Schema in Python DSL
Save the binary file in Python
Linebot creation & file sharing in Python
(sqlalchemy) Display text in select field
Dynamically load json type in python
Create a binary file in Python
Waveform display of audio in Python
Display characters like AA in python
The story of the "hole" in the file
Make matplotlib Japanese compatible in 3 minutes
ORC, Parquet file operations in Python
Save a YAML-formatted file in PyYAML
Configuration file best practices in Flask
How to handle Japanese in Python