Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: Using Visual basic 6.0 to post an XML doc encoded with ISO-8859-1

From: Martin Honnen <mahotrash@-----.-->
To: 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. &#233  
> 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/


transparent
Print
Mail
Like It
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