Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

encoding of XML DOM document created in memory

8 views
Skip to first unread message

Martin Honnen

unread,
May 1, 2008, 12:04:56 PM5/1/08
to

In
http://groups.google.com/group/mozilla.dev.ajax/browse_thread/thread/e0e6ccdf8dcaac95/a8544ca54082f1e1?lnk=st&q=#a8544ca54082f1e1
someone complains that Firefox 3.0 encodes an XML DOM document created
with document.implementation.createDocument() and sent with the send()
method of XMLHttpRequest as ISO-8859-1. I can confirm that. The
documentation http://developer.mozilla.org/en/docs/XMLHttpRequest says
that Firefox prior to 3.0 always used UTF-8 while Firefox 3.0 uses
doc.characterSet to encode an XML DOM document passed to the send
method. The problem however is that Firefox in both 2.0 and 3.0 sets the
characterSet property of a document created with
document.implementation.createDocument() to ISO-8859-1 and you can't
change that with script as far as I can see. That means that now with
Firefox 3.0 all such documents are ISO-8859-1 encoded which is a problem
to people who want to send UTF-8 encoded documents and process them on
the server. Also using ISO-8859-1 causes a bloat of the sent data as any
characters outside of that encoding are then sent as numerical character
references.
Does anyone know why Firefox sets characterSet to ISO-8859-1 for XML DOM
documents created in memory with createDocument? Is it possible to
change that to UTF-8?


--

Martin Honnen
http://JavaScript.FAQTs.com/

Martin Honnen

unread,
May 1, 2008, 12:26:17 PM5/1/08
to
Martin Honnen wrote:

> Does anyone know why Firefox sets characterSet to ISO-8859-1 for XML DOM
> documents created in memory with createDocument? Is it possible to
> change that to UTF-8?

It seems the original post was multi-posted to the dom group
http://groups.google.com/group/mozilla.dev.tech.dom/browse_thread/thread/cdb39c617034c75a#
and Boris has already answered it there, suggesting that it might make
sense to file a bug on changing the characterSet to UTF-8. I will do
that then.

Martin Honnen

unread,
May 1, 2008, 12:47:33 PM5/1/08
to
Martin Honnen wrote:

> It seems the original post was multi-posted to the dom group
> http://groups.google.com/group/mozilla.dev.tech.dom/browse_thread/thread/cdb39c617034c75a#
> and Boris has already answered it there, suggesting that it might make
> sense to file a bug on changing the characterSet to UTF-8. I will do
> that then.

https://bugzilla.mozilla.org/show_bug.cgi?id=431701

0 new messages