文件read 打开出错
>>> f.read()Traceback (most recent call last):
File "<pyshell#19>", line 1, in <module>
f.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0x80 in position 26: illegal multibyte sequence
这是什么情况? 编码问题,在打开文件时,指定正确的编码 f=open(file_name,"r", encoding="UTF-8")
页:
[1]