python读取文件时提示UnicodeDecodeError错误:
"UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 205: illegal multibyte sequence"
“UnicodeDecodeError: 'cp950' codes can't decode byte oxc3 in position 25402: illegal multibyte sequence”
解决办法1:打开文件时指定编码格式‘gbk’、‘UTF-8’
FILE_OBJECT= open('order.log','r', encoding='UTF-8')
解决办法2:打开文件时用读二进制的方式
FILE_OBJECT= open('order.log','rb')