set oStream = server.CreateObject("ADODB.Stream")
oStream.Type=2
oStream.Mode=3
oStream.Open()
oStream.Charset = "utf-8" 'newcodepage 新的编码
oStream.WriteText mb_code
oStream.Position= 0
oStream.Type= 2
oStream.Charset="GB2312" 'oldcodepage 旧的编码
oStream.SaveToFile server.MapPath(filepath),2
oStream.Close()
set oStream = nothing
与原来的文件本身的编码没有关系
好久没有用asp了.今天帮同事看生成静态页时需要utf-8编码,的解决方案.FSO好像没有地方设制编码
asp 中生成静态页utf-8编码
最新推荐文章于 2021-06-05 13:44:55 发布
本文介绍了一种在ASP中将文件从UTF-8编码转换为GB2312编码的方法。通过使用ADODB.Stream对象来读取和写入文件内容,并设置不同的字符集完成编码转换。
2183

被折叠的 条评论
为什么被折叠?



