1、python2 打印中文乱码解决办法

  python2打印列表,字典里面含有中文时,会乱码

a= {"id": 1, "title": "标题1".decode('utf-8')}
print json.dumps(a, encoding='UTF-8', ensure_ascii=False)

  python2写入文件含有中文,不受影响

 

相关文章:

  • 2021-12-03
  • 2022-02-21
  • 2021-08-30
  • 2022-12-23
  • 2021-06-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-06
  • 2022-02-14
  • 2021-04-23
  • 2021-12-15
  • 2021-11-24
  • 2022-01-17
  • 2022-02-09
相关资源
相似解决方案