- file = "1.txt"
- Set oStream = CreateObject("ADODB.Stream")
- oStream.Type = 2 'adTypeText
- oStream.Mode = 3 'adModeReadWrite
- oStream.Charset = "UTF-8" '原编码
- oStream.Open()
- oStream.LoadFromFile file
- s = oStream.ReadText()
- oStream.Close()
- oStream.Charset = "UTF-16" '目标编码
- oStream.Open()
- oStream.WriteText s
- oStream.SaveToFile file, 2 'adSaveCreateOverWrite
- oStream.Close()
复制代码
批护理开头先弄个chcp 65001
批处理最后用这个vbs转换文件编码 |