【发布时间】:2019-08-08 23:01:59
【问题描述】:
我不知道适合我情况的标题。
data=[]
for title in titles:
real_title = ''.join(str(title.text).split())
print(real_title)
data.append(real_title)
with open(os.path.join(BASE_DIR, 'result.json'), 'w+') as json_file:
json.dump(data, json_file)
当python ~~.py时,效果很好。打印(真实标题)显示
이스케이프룸
但是当我打开 json_file 时:
"\uc774\uc2a4\ucf00\uc774\ud504\ub8f8"
有什么问题?为什么 utf-8 字母字面上保存为 utf-8?
【问题讨论】:
标签: python