You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There is currently now feature implemented to do this. It could be added as additional parameter to the dump function. In Python's json.dump function, there is a parameter ensure_ascii for this:
If ensure_ascii is true (the default), all non-ASCII characters in the output are escaped with \uXXXX sequences, and the result is a str instance consisting of ASCII characters only. If ensure_ascii is false, some chunks written to fp may be unicode instances. This usually happens because the input contains unicode strings or the encoding parameter is used. Unless fp.write() explicitly understands unicode (as in codecs.getwriter()) this is likely to cause an error.
Internally, function escape_string needs to be changed for this. It currently only escapes control characters to \uxxxx.
Activity
[-]UTF-8/Unicode escape and dump[/-][+]UTF-8/Unicode escaping and dumping[/+][-]UTF-8/Unicode escaping and dumping[/-][+]UTF-8/Unicode escape and dump[/+]nlohmann commentedon Oct 15, 2016
There is currently now feature implemented to do this. It could be added as additional parameter to the
dumpfunction. In Python'sjson.dumpfunction, there is a parameterensure_asciifor this:Internally, function
escape_stringneeds to be changed for this. It currently only escapes control characters to\uxxxx.Merge pull request #654 from ryanjmulder/develop
nlohmann commentedon Jul 12, 2017
The feature is implemented with #654