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


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

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

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

勿用于学术性引用。

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

 

本文不定期修正完善。

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

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

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

"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就好。

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM