python 读取文件时报错UnicodeDecodeError

python 读取文件时报错UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal multibyte sequence

python读取文件时提示"UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal multibyte sequence"

解决办法1.

  

FILE_OBJECT= open('data.txt','r', encoding='UTF-8')

解决办法2.

  

FILE_OBJECT= open('data.txt','rb')
posted @ 2018-04-22 15:50  sneike  阅读(1139)  评论(0编辑  收藏  举报