R. David Murray added the comment: If I fix your example so it runs:
json.dump({'name': "港区"}, open('myfile.json', 'w'), indent=4, separators=(',', ': '), ensure_ascii=False) I get the expected output: rdmurray@pydev:~/python/p34>cat myfile.json { "name": "港区" } That example won't work in python2, of course, so you'd have to show us your actual code there. ---------- nosy: +r.david.murray _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue22701> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com