写文件报数据。

同样的编码。

含中文字段的输出文件 编码为utf-8

无中文的却是asc

 

import codecs
txt = u”qwer”
file=codecs.open(“test”,”w”,”utf-8-sig”)
file.write(txt)
file.close()

 

解决

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-25
  • 2021-05-26
  • 2022-12-23
  • 2022-01-05
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-17
  • 2022-12-23
  • 2021-10-23
  • 2022-12-23
相关资源
相似解决方案