hlprogrammer

with open("文件路径","rb") as f:

  a=f.read()

  print(a.decode("utf-8"))

  f.close()

问题主要出在编码方式上,linux的编码方式为utf-8,而windows的编码方式为gbk,所以解码时要根据系统而定。

分类:

技术点:

相关文章:

  • 2021-12-30
  • 2022-12-23
  • 2022-02-16
  • 2021-09-14
  • 2022-12-23
  • 2022-12-23
  • 2021-06-09
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-02-10
  • 2021-07-19
  • 2022-12-23
  • 2021-09-22
  • 2021-10-01
相关资源
相似解决方案