Unicode values in strings are escaped when dumping to JSON in Python

json, python, unicode

Solution

Pass the `ensure_ascii=False` argument to json.dumps:

>>> print(json.dumps('růže', ensure_ascii=False))
"růže"

Problem

For example: ``` >>> print(json.dumps('růže')) "r\u016f\u017ee" ``` (Of course, in the real program it's not just a single string, and it also appears like this in the file, when using `json.dump()`) I'd like it to output simply "růže" as well, how to do that?

Original source

Related problems