[issue22701] Write unescaped unicode characters (Japanese, Chinese, etc) in JSON module when "ensure_ascii=False"

R. David Murray report at bugs.python.org
Wed Oct 22 21:39:35 CEST 2014


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 at 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 <report at bugs.python.org>
<http://bugs.python.org/issue22701>
_______________________________________


More information about the Python-bugs-list mailing list