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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

XML text received is not what was sent by server

Status
Not open for further replies.

OnQueIT

Programmer
Nov 12, 2003
18
0
0
US
I am receiving a EULA from a server. When I get it and look at what I got, the text has been changed. Some of the EULA is in French which has words with a grave accent (è) encoded, but when I get it, the letters are changed to a question mark(?). Example: pr?ntes should be présentes. Any clues as to why this is happening would be appreciated.

Here is similar code I am using to POST and receive data back from the server:
oHTTP = CREATEOBJECT("Microsoft.XMLHTTP")
oHTTP.Open("POST", {Server Address} ,.F.)
oHTTP.setRequestHeader("Content-Type","text/xml")
oHTTP.Send(lcXML)
orXML = oHTTP.responseText

Is it in the way I'm requesting from the server or is it a language pack for FoxPro I need?
 
You can tell for certain whether or not this is a VFP problem by looking ag the raw XML outside of VFP (say in Notebook). What does the character look like there?

Anyway, I would say that the problem is likely that you're not including the correct character set parameter in the Content-type header. I would suggest trying this one:

Content-Type: text/html; charset:ISO646-FR1;



-BP (Barbara Peisch)
 
I start by creating lcXML and the first line of it is:
lcXML = [<?xml version=&quot;1.0&quot; encoding = &quot;ISO-8859-1&quot;?>]
lcXML = lcXML + CHR(10) + [<Request>]
lcXML = lcXML + CHR(10) + [<TransactionReference>]
fill in the rest your self
lcXML = lcXML + CHR(10) + [</TransactionReference>]
lcXML = lcXML + CHR(10) + [</Request>]
followed by:

oHTTP = CREATEOBJECT(&quot;Microsoft.XMLHTTP&quot;)
oHTTP.Open(&quot;POST&quot;, {Server Address} ,.F.)
oHTTP.setRequestHeader(&quot;Content-Type&quot;,&quot;text/xml&quot;)
oHTTP.Send(lcXML)
orXML = oHTTP.responseText

so, would I need to change the oHTTP.setRequestHeader parms or were you referring to the what is in the lcXML variable? I did see from Microsoft that I should be using .responseXML instead of .responseText.
 
My point was that I don't think ISO-8859-1 takes French characters into account. I think you need to use ISO-646-FR1 instead.


-BP (Barbara Peisch)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top