Saving utf-8 texts in json.dumps as UTF8, not as \u escape sequence


>>> d = {1: "ברי צקלה", 2: u"ברי צקלה"}
>>> json_str = json.dumps(d).decode('unicode-escape').encode('utf8')
>>> print json_str
{"1": "ברי צקלה", "2": "ברי צקלה"}


0 comments

Popular Posts

无觅相关文章插件,迅速提升网站流量