Gilmeh Serda <gilmeh.ser...@nothing.here.invalid> writes:

> Is there something that can be done when writing JSON using its dump/
> dumps feature so, e.g. Cyrillic text will show up correctly in a text 
> editor afterwards?
> ...
> The 'template.json' contains this:
>
> {
>     "test": "øæßþåнайтеĦŒŒ®®®"
> }
>
> What the json module outputs to the 'output.json' file is:
>
> {"test": "\u00f8\u00e6\u00df\u00fe\u00e5\u043d\u0430\u0439\u0442\u0435
> \u0126\u0152\u0152\u00ae\u00ae\u00ae"}
>
> But I would really like to be able to read that.

The "dumps" function has a parameter which allows the use
of unicode (instead of ascii encoded) strings.
Likely, using this parameter will solve your problem.


I have found out that some browsers have problems with some
unicode characters. Maybe, this is one reason to have
ascii encoded strings the default for "dumps".

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to