第一种解决方法,增加encoding=‘UTF-8’:
FILE_OBJECT= open( 'train.txt','r', encoding='UTF-8' )
第二种方法,二进制读取:
FILE_OBJECT= open( 'train.txt', 'rb' )
解决UnicodeDecodeError: 'gbk' codec can't decode byte 0xb9 in position x: illegal multibyte sequence
最新推荐文章于 2025-04-24 10:44:29 发布