1. 程式人生 > >Python3 json.dumps中文亂碼解決方法

Python3 json.dumps中文亂碼解決方法

1.python檔案開頭匯入

from __future__ import unicode_literals
import json
string = '今天'
print(json.dumps(str,ensure_ascii=False))

參考資料:https://blog.csdn.net/qq_35277505/article/details/78953876