“rb”,”wb”这两种方式在操作文件时,直接跳过了系统的编码方式,在windows系统中,用的编码为gbk: ①:with open(“a.txt”,”w”) as f1: F1.write(“aa”) 默认用gbk进行编码并且写入. ②: with open(“a.txt”,”r”) as f1: Print(F1.read()) 默认用gbk编码进行解码 ③: with open(“a.txt”,”wb”) as f1: F1.write(“aa”.encode(“utf-8”)) 跳过了…