encoding of XML DOM document created in memory

View: New views
3 Messages — Rating Filter:   Alert me  

encoding of XML DOM document created in memory

by Martin Honnen-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


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/
_______________________________________________
dev-tech-xml mailing list
dev-tech-xml@...
https://lists.mozilla.org/listinfo/dev-tech-xml

Re: encoding of XML DOM document created in memory

by Martin Honnen-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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
        http://JavaScript.FAQTs.com/
_______________________________________________
dev-tech-xml mailing list
dev-tech-xml@...
https://lists.mozilla.org/listinfo/dev-tech-xml

Re: encoding of XML DOM document created in memory

by Martin Honnen-3 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

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

--

        Martin Honnen
        http://JavaScript.FAQTs.com/
_______________________________________________
dev-tech-xml mailing list
dev-tech-xml@...
https://lists.mozilla.org/listinfo/dev-tech-xml