Setting content-type and encoding on XMLHTTPRequest

A

Ari Krupnik

When I send an XML document over XMLHTTPRequest, IE encodes it in
UTF-16, but fails to set the "encoding" part of "Content-Type:"
header. According to rfc 2616, default encoding in HTTP is
ISO-8859-1. Parsing a UTF-16 stream as ISO-8859-1 of course fails on
well-formedness errors.

In Mozilla, I can call setRequestHeader() and specify the actual
content type, but IE seems to ignore this call if the header name is
"Content-Type".

To make this work, I need to either make IE serialize the document in
ISO-8859-1, or to set the correct Content-Type. How can I do this?


Ari.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,051
Latest member
CarleyMcCr

Latest Threads

Top