在使用的时候,先用WriteOut生成一个临时文件(UTF-8带BOM),然后用Convert2utf8将BOM头的前三个字节删除. ---------------------------------------------------------- Private Sub WriteOut(strPath As String, str As String) Dim objStream As Object Set objStream = CreateObject("ADODB.St
需求:将utf-8格式的文件转换成gbk格式的文件 实现代码如下: def ReadFile(filePath,encoding="utf-8"): with codecs.open(filePath,"r",encoding) as f: return f.read() def WriteFile(filePath,u,encoding="gbk"): with codecs.open(filePath,"w",encodi