=================================版权声明=================================

版权声明:原创文章 谢绝转载 

请通过右侧公告中的“联系邮箱(wlsandwho@foxmail.com)”联系我

勿用于学术性引用。

勿用于商业出版、商业印刷、商业引用以及其他商业用途。                   

 

本文不定期修正完善。

本文链接:http://www.cnblogs.com/wlsandwho/p/8521785.html

耻辱墙:http://www.cnblogs.com/wlsandwho/p/4206472.html

=======================================================================

UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 199: illegal multibyte sequence

"C:\Program Files\Python36-32\python.exe" C:/PythonResearch/NaiveBayes/Test_bayes.py
Traceback (most recent call last):
  File "C:/PythonResearch/NaiveBayes/Test_bayes.py", line 77, in <module>
    emailText=open('email\\ham\\23.txt','r').read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0xae in position 199: illegal multibyte sequence

Process finished with exit code 1

解决问题很简单,把文件用记事本打开,然后另存为,下面编码选ANSI就好。

 

相关文章:

  • 2021-10-26
  • 2021-07-22
  • 2022-01-16
  • 2021-10-25
  • 2021-06-14
  • 2021-12-15
  • 2021-11-19
猜你喜欢
  • 2021-08-15
  • 2021-09-21
  • 2021-04-19
  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2022-12-23
相关资源
相似解决方案