今天学习python中使用jieba库,遇到了错误:“UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 0: invalid continuation byte”,因为是需要打开txt文件的操作,执行代码是“

txt=open("threekingdoms.txt","r",encoding="utf-8").read()”,后来发现是txt文件存储格式的问题,将文件存储为utf-8的格式,成功解决

相关文章:

  • 2021-08-29
  • 2021-09-28
  • 2021-06-26
  • 2021-03-31
  • 2021-11-30
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-01-16
  • 2021-06-07
  • 2022-12-23
  • 2021-07-07
  • 2021-07-18
  • 2022-12-23
  • 2021-06-11
相关资源
相似解决方案