>>> a = "\u041c\u0430\u0441\u043b\u043e" >>> a 'Масло' >>> json.dumps({'a': a}) '{"a": "\\u041c\\u0430\\u0441\\u043b\\u043e"}' >>>
Вопрос: Как получить русский текст в JSON?
>>> a = "\u041c\u0430\u0441\u043b\u043e" >>> a 'Масло' >>> json.dumps({'a': a}) '{"a": "\\u041c\\u0430\\u0441\\u043b\\u043e"}' >>>
JSON text SHALL be encoded in UTF-8, UTF-16, or UTF-32. The default
encoding is UTF-8…
If the character is in the Basic
Multilingual Plane (U+0000 through U+FFFF), then it may be
represented as a six-character sequence: a reverse solidus, followed
by the lowercase letter u, followed by four hexadecimal digits that
encode the character's code point. The hexadecimal letters A though
F can be upper or lower case. So, for example, a string containing
only a single reverse solidus character may be represented as
“\u005C”.
$ python3 Python 3.3.1 (default, Apr 15 2013, 23:57:40) [GCC 4.7.2 20121109 (ALT Linux 4.7.2-alt7)] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import json >>> a = "Масло" >>> json.dumps({'a': a}, ensure_ascii=False) '{"a": "Масло"}' >>>