db = MySQLdb.connect(host="xxx", user="xxx", passwd="xxx", db="xxx",charset="utf8", autocommit=True)

2. pandas编码

修改系统编码

import sys

reload(sys)
sys.setdefaultencoding('utf8')

read_csv

import pandas as pd
pd.read_csv(input_path, encoding='utf-8')

3. json编码

key_words="tuyến_tiền_liệt"
json.dumps(key_words).decode('unicode-escape').encode('utf8')

相关文章:

  • 2022-02-18
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-10
  • 2021-09-19
  • 2021-09-14
猜你喜欢
  • 2022-12-23
  • 2022-01-09
  • 2021-09-19
  • 2021-07-20
  • 2022-01-31
  • 2021-09-02
  • 2021-10-29
相关资源
相似解决方案