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
withio.open('filename', 'w', encoding='utf8') asjson_file:
data=json.dumps(u"ברי צקלה", ensure_ascii=False)
# unicode(data) auto-decodes data to unicode if strjson_file.write(unicode(data))
感谢项目组大大能修正下数据文件。谢谢!
The text was updated successfully, but these errors were encountered:
Python代码中 json.dumps() 函数在存储中文的时候需要加入参数
ensure_ascii=False
才能正确存储数据到json文件。不然就会产生现在这样的编码错误。示例代码如下:
正确的用法:
感谢项目组大大能修正下数据文件。谢谢!
The text was updated successfully, but these errors were encountered: