Below is the test program, including a Chinese character:
# -*- coding: utf-8 -*- import json j = {\"d\":\"中\", \"e\":\"a\"} json = json.dumps(j, encoding=\
Use simplejson with the mentioned options:
# -*- coding: utf-8 -*- import simplejson as json j = {"d":"中", "e":"a"} json = json.dumps(j, ensure_ascii=False, encoding="utf-8") print json
Outs:
{"e": "a", "d": "中"}