Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


DOMDocument encoding in ouput from a VB6 application

From: aim@----------.--.-- (-----)
To: NULL
Date: 4/1/2005 3:11:00 AM
Hi,

I am using VB6 to generate XML documents.  My application reads in
text (line by line) from templates (i.e. text files that are saved as
.xml files, in ANSI encoding).

I create the output as a text file with a .xml extension after parsing
the templates, using Scripting.TextStream.  I need the output XML
files to be saved with "UTF-8" encoding.  When I produce the output
XML files, I specify in the declaration:

<?xml version="1.0" encoding="UTF-8" ?>

My problem is that I am unable to save the ouput as UTF-8.  When I
open the output file in Notepad and select Save As, the current
encoding is still ANSI.  If I open the output file and save it as (All
Files) --> UTF-8, this DOES save it in the correct encoding.  I know
this becoause I can then open this file again and if I select Save As,
the current encoding is now UTF-8.

I need to be able to save as UTF-8 programmatically as my application
is a scheduled service.  Getting the customer to open the output file
in Notepad and then Save As UTF-8 is an option, but not a
feasible/practical one. I have attempted to use the DOMDocument, i.e.
load the output file into this object and then save it again (as I
heard that the .save method saves as UTF-8).  However, this is still
saving the output as ANSI (I checked using Notepad).

I appreciate any advice / guidance on how to tackle this problem. 
Thanks.

Jimmy


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent