encoding="utf-8"):withcodecs.open(filePath,"r",encoding)asf:returnf.read()defWriteFile(filePath,u,encoding="utf-8-sig"):#with codecs.open(filePath,"w",encoding) as f:withcodecs.open(filePath,"wb")asf:f.write(u.encode(encoding,errors="ignore"))defUTF8_2_GBK(src,dst):content=...