Altova Mailing List Archives>Archive Index >microsoft.public.xml Archive Home >Recent entries >Thread Prev - Using Visual basic 6.0 to post an XML doc encoded with ISO-8859-1 >Thread Next - Re: Using Visual basic 6.0 to post an XML doc encoded with ISO-885 Re: Using Visual basic 6.0 to post an XML doc encoded with ISO-8859-1To: NULL Date: 6/1/2005 1:03:00 PM
David Heffler wrote:
> I am new to XML and I have run into a problem that I am hoping someone can
> help me with. I have created a program to load an XML document and post it
> using ISP-8850-1 encoding. The following is my code:
>
> Dim request As String
> Dim xmldoc As New MSXML2.DOMDocument40
> Dim response As New MSXML2.DOMDocument40
> xmldoc.Load ("c:\uss\uss4.0\ups\licrequest.xml")
> Dim xmlhttp As New MSXML2.XMLHTTP40
> xmlhttp.open "POST", "https://www.ups.com/ups.app/xml/License", False
> xmlhttp.setRequestHeader "Content-type", "text/xml;charset=ISO-8859-1;"
> xmlhttp.send (xmldoc.xml)
> request = xmlhttp.responseText
> MsgBox request
>
> The document it is sending has the following code embedded into it. é
> The provider is sending back a message that the document is sending invalid
> text and that the code is being red as <c3><a9> instead of the acute accent
> (é) encoded properly as <e9>
If you send a string (which you do with xmlhttp.send(xmldoc.xml)) then
the string is always UTF-8 encoded.
General, if you want to send an XML DOM document then pass the document
itself to the send method e.g.
xmlhttp.send(xmldoc)
then there isn't even a need to set the Content-Type header yourself.
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
