在国内的话,一般就是GBK比较多了,Windows默认是gbk,所以打开一些文件会这样
在读写文件过程中加上utf-8编码格式
with open(you_file_path, 'r', encoding='utf-8') as f: f_content = f.read() pass