Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an XML file with special characters

Status
Not open for further replies.

emozley

Technical User
Jan 14, 2003
769
GB
Hi,

I am trying to write something in vbscript that gets the list of applications installed (add/remove programs) and saves it as an XML file.

I then went to use some more vbscript to send that XML to my web service which will save the data in a database (SQL server).

It's all going quite well however special characters are causing me major problems.

I know that I need to use vbscript to replace & with &amp; and < with &lt; but there are loads of other symbols like the trade mark sign ™ that I don't know how to handle.

In my script I have

Code:
set f=fs.CreateTextFile("log.xml",true)
f.WriteLine("<?xml version=""1.0"" encoding=""UTF-8""?>")

However when I send it to the webservice it saves special characters as a ?.

Also if I try different encodings if I try to open the XML file in internet it looks fine but still doesn't submit properly to the webservice.

Any ideas?

Thanks very much

Ed
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top