About the processing method of python dictionary Chinese display

Recently at work, I encountered a problem that the dictionary contains Chinese, showing \uxxxx, and I cannot input normal Chinese no matter how to convert: {"gc": "\u4eba\u751f\u7f8e\u597d", "ga": "\u5e7f\u53d1\ u4eba"} , irritable. . .

Suddenly, heard this method works: json.dumps(codeListDir, encoding="UTF-8", ensure_ascii=False, sort_keys=False, indent=4) 

When I print the dictionary again, it outputs normal Chinese characters. Brothers who have referenced, remember to like it.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324952896&siteId=291194637