开发者

Saving FileSystemObject as UTF

开发者 https://www.devze.com 2023-01-01 13:10 出处:网络
how can i save the file in utf-8? Dim FSO, File Set FSO = Server.CreateObject(\"Scripting.Fi开发者_如何学CleSystemObject\")

how can i save the file in utf-8?

Dim FSO, File   
Set FSO = Server.CreateObject("Scripting.Fi开发者_如何学CleSystemObject")   
Set File = FSO.OpenTextFile(Path,2,true,-1)   
File.Write(xml1)   
File.Close   
Set File = Nothing  
Set FSO = Nothing  


I'd try the ADODB Stream object.

Dim objStream 
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Type = adTypeText
objStream.Mode = adModeReadWrite
objStream.Open
objStream.Position = 0
objStream.Charset = "UTF-8"
objStream.WriteText strContent
objStream.SaveToFile strABSPath,adSaveCreateOverWrite
objStream.Close
Set objStream=nothing
0

精彩评论

暂无评论...
验证码 换一张
取 消