473,753 Members | 5,001 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Save a file in UTF-8 format from ASP vbscript

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

Set zzzz = fso.OpenTextFil e(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.CreateOb ject("ADODB.Str eam")
objStream.Open
objStream.Type = adTypeText
objStream.Posit ion = 0
objStream.Chars et = "utf-8"
objStream.LoadF romFile filepath
objStream.SaveT oFile filepath, adSaveCreateOve rWrite
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
0 14965

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
2457
by: Francesc Guim Bernat | last post by:
Dear Colleagues, i'm developing a C++ .NET based application that works with System.Xml library. My problem appears when i try to save a document througt XmlDocument->Save method, because it seems to add some strange characters at the beginning of the saved XML document. For instance, if first i print the document throught System::Console
2
13099
by: gnv | last post by:
Hi all, I am writing a cross-browser(i.e. 6 and netscape 7.1) javascript program to save an XML file to local file system. I have an xml string like below: var xmlStr = "<?xml version="1.0" encoding="UTF-8"?><a>some info</a>"; I want to save this xml file to local file system with JavaScript,
6
11387
by: Scot | last post by:
How do I get the following code to not put the Unicode BOM in the file. If the attribute ecoding=UTF-8 exists, it will put the BOM in the file. objXMLDocument = New XmlDocument objXMLDocument.Load("C:\test.xml") 'change the xml file objXMLDocument.Save("C:\test.xml")
2
16407
by: Michael Lehar | last post by:
Hallo I have a pictureBox with a picture loaded from file, then I draw some lines on the picture, and then I want to save the new picture. Befor I can draw lines I have to create a Graphics object, with g = pictureBox.CreateGraphic, and draw lines g.drawLines(....) But when saving the picture, the new picture have no lines, it is only a copy.
3
2154
by: Stefano | last post by:
I've a form windows with a lot of textbox controls. How can I do if I have to save all text proprety of this controls in an external file, to reload them in future?
3
3129
by: ferd | last post by:
Hello, I want to query an access database in ASP (classic) and save the results as an XML file that I can use as a Data Island in Internet Explorer - I have the recordset, I can save it as XML, but there's a bunch of junk at the beginning of the file that makes the IE data island mechanism not work. here's what I do: dim objXML
10
39512
by: Henok Girma | last post by:
Hello Gurus, I want to save the state of an unbound DataGridView on my Windows Form application to an XML file so i can later load it back.. Basically, on my form I have a DataGridView, it's got some DataGridViewTextBoxCell, DataGridViewComboBoxCell etc, i want to export all that to XML.. Any help is greatly appreciated.
0
1521
by: joffypf | last post by:
hi how can save utf-8 encoded string to a text file. I tryed to save unicode string but unicode string only display just ike '????'. please help me...
4
2075
abehm
by: abehm | last post by:
Hello, I am trying to save an entire xml document as a string and then insert it to a sql server db as an xml data type. The problem is when I read the xmldocument to the string, somewhere along the way "\"'s are inserted in front of the attribute values in the xml. Can anyone help me? if (File.Exists(file)) { XmlDocument mydoc = new XmlDocument(); mydoc.Load(file); xmlsrc =...
1
1768
by: not_a_commie | last post by:
Here are a few thoughts for loading and storing your xml using the XmlDocument class: First, don't ever insert the header manually. This is to be done by the writer. In other words, don't do this: document.AppendChild(document.CreateXmlDeclaration("1.0", "UTF-8", null)); If you do that and then write your document to a stream with an
0
9113
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9706
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9503
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8372
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4795
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4983
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3439
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2924
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2324
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.