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

=================================版權聲明=================================html

版權聲明:原創文章 謝絕轉載 
python

請經過右側公告中的「聯繫郵箱(wlsandwho@foxmail.com)」聯繫我編碼

勿用於學術性引用。spa

勿用於商業出版、商業印刷、商業引用以及其餘商業用途。                    code

 

本文不按期修正完善。
htm

本文連接:http://www.cnblogs.com/wlsandwho/p/8521785.htmlblog

恥辱牆:http://www.cnblogs.com/wlsandwho/p/4206472.htmlget

=======================================================================it

"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

io

解決問題很簡單,把文件用記事本打開,而後另存爲,下面編碼選ANSI就好。

相關文章
相關標籤/搜索