Hi,

I'm trying to get some data from an external website using XMLHTTP, but my
problem is that the data is with special danish characters in (ÆØÅ), which
are being replaced with "?" due to UTF-8.
I've tried to specify the charset using response.charset, but that doesn't
seem to have any effect.

Any suggestions, or alternative solutions to XMLHTTP?
Thanks.
--
Med venlig hilsen
Sune Christesen
http://www.ActiveWebs.dk/

Re: Charset in XMLHTTP or an alternative solution? by Martin

Martin
Wed Aug 31 08:26:42 CDT 2005



Sune Christesen wrote:

> I'm trying to get some data from an external website using XMLHTTP, but
> my problem is that the data is with special danish characters in (ÆØÅ),
> which are being replaced with "?" due to UTF-8.

If you are using the responseText property then the server's response is
treated as UTF-8. But if the response is XML and sent with an XML MIME
type (e.g. application/xml or text/xml) then XMLHTTP uses the XML parser
to populate the responseXML property and the XML parser knows how to
deal with different encodings. Thus if the server sends XML then you can
read out the data from responseXML using the DOM.

> Any suggestions, or alternative solutions to XMLHTTP?

ADODB.Stream can read from a URL and then gives you a byte stream you
can read out as text after you specify which encoding/charset you think
the stream is encoded as:
<http://msdn.microsoft.com/library/default.asp?url=/library/en-us/ado270/htm/mdobjstream.asp>

--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/