python 3以上版本使用pickle.load讀取文件報UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 6
只需要在打開的時候指定編碼: encoding = 'iso-8859-1'? ?如下所示:
fo = open(file, 'rb')
dict = pickle.load(fo,encoding='iso-8859-1')
python 3以上版本使用pickle.load讀取文件報UnicodeDecodeError: 'ascii' codec can't decode byte 0x8b in position 6
只需要在打開的時候指定編碼: encoding = 'iso-8859-1'? ?如下所示:
fo = open(file, 'rb')
dict = pickle.load(fo,encoding='iso-8859-1')