424,054 Members | 1,078 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,054 IT Pros & Developers. It's quick & easy.

Save a file in UTF-8 format from ASP vbscript

P: n/a
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
Jul 19 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.