'utf-8' codec can't decode byte 0xc8 in position 0
今天学习python中使用jieba库,遇到了错误:“UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc8 in position 0: invalid continuation byte”,因为是需要打开txt文件的操作,执行代码是“
txt=open("threekingdoms.txt","r",encoding="utf-8").read()”,后来发现是txt文件存储格式的问题,将文件存储为utf-8的格式,成功解决