Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
XMLHTTP - How to generate and use responseXML?
Message
 
 
To
30/08/2006 17:47:06
General information
Forum:
Visual FoxPro
Category:
Internet applications
Miscellaneous
Thread ID:
01149833
Message ID:
01150045
Views:
21
Thanks very much for that reference Greg. After looking through it and experimenting a bit, I found that just placing this in the ASP code:
Response.ContentType = "text/html; charset=ISO-8859-1"
...solves the problem, without needing to resort to sending HTML encapsulated within an XML package. It turns out (I'm pretty sure now) that UTF-8 is not what I wanted.

Characters from the ISO-8859-1 charset now seem to be coming through. For example, this sprite-like thingy: ¤
And if you can see it OK (as I can when composing this reply) it just shows that UT is also set to use ISO-8859-1. It just happens to be the default charset in many situations. But I think that xmlhttp in some circumstances uses UTF-8 unless explicitly told to use a specific char set, rather than defaulting to ISO-8859-1.


>>Client-side javascript in my app does a lot of XMLHTTP calls to collect snippets of HTML and refresh portions of the web page using the ResponseText property of the xmlhttp object.
>>
>>Currently, the web server simply spits out HTML snippets in response to either a post or get request from the xmlhttp object. This works fine. However, there is a known IE bug when non-ascii characters are transmitted in the ResponseText. Those characters get garbled.
>>
>>I've read that you can use XML (using the ResponseXML property of the xmlhttp object) to circumvent the non-ascii-character bug by encapsulting the HTML snippet within an XML package. I just need some pointers on how to actually do this... especially what the server needs to do to create acceptable XML with the appropriate HTTP headers that all gets sent back to the xmlhttp object for parsing on the client.
>>
>>All I'm trying to do is get around the problem where certain European/Latin characters (high order bit set in single-byte character) get munged when using ResponseText.
>>
>>Thanks very much!
>
>Bingo. Here a web page with discuss the same problem with a solution.
>
>http://groups.google.com/group/microsoft.public.scripting.jscript/browse_thread/thread/b9299f0aa02dc2f0/bd3fe912d71a2ac4%23bd3fe912d71a2ac4
>
>The actual setting for the "Content-type" is "application/x-www-form-urlencoded; charset=utf-8");
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform