Desired output:
'{"a": "йцукен"}'
I tried this:
>>> import json
>>> json.dumps({'a': 'йцукен'})
'{"a": "\\u0439\\u0446\\u0443\\u043a\\u0435\\u043d"}'
How can I avoid these U-codes and print normal symbols?
I am using Python 3.
Desired output:
'{"a": "йцукен"}'
I tried this:
>>> import json
>>> json.dumps({'a': 'йцукен'})
'{"a": "\\u0439\\u0446\\u0443\\u043a\\u0435\\u043d"}'
How can I avoid these U-codes and print normal symbols?
I am using Python 3.
You can use the ensure_ascii
keyword argument as shown here:
json.dumps({'a': 'йцукен'}, ensure_ascii=False)