save 中文 to a json file

https://qastack.cn/programming/18337407/saving-utf-8-texts-in-json-dumps-as-utf8-not-as-u-escape-sequence

 

with open('filename', 'w', encoding='utf8') as json_file:
    json.dump("ברי צקלה", json_file, ensure_ascii=False)

posted on 2021-10-20 17:37  cdekelon  阅读(37)  评论(0)    收藏  举报

导航