Save a file in UTF-8 format from ASP vbscript

J

JTMar

I need to save a file in UTF-8 format from an ASP file.
Using FileSystemObject I can only save them in Unicode (UTF-16, I think) but
not in UTF-8:

Set zzzz = fso_OpenTextFile(filepath, 2, true, -1)

How do I can save my file in UTF-8 format ?

I have tried to convert the file to UTF-8, with this code:

Dim objStream
Set objStream = Server.CreateObject("ADODB.Stream")
objStream.Open
objStream.Type = adTypeText
objStream.Position = 0
objStream.Charset = "utf-8"
objStream.LoadFromFile filepath
objStream.SaveToFile filepath, adSaveCreateOverWrite
objStream.Close
set objStream = nothing

But, that code doesn't do anything and no error occurs. :-?

Thanks in advance for your replays
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top