[Twisted-web] Encoding bug in Safari's XMLHttpRequest

David Remahl chmod007 at gmail.com
Fri Feb 11 10:24:28 MST 2005


Playing around with LiveSite I encountered a bug in Apple's webkit
which is used by Safari, OmniWeb and a few other browsers. The
XMLHttpRequest object used by those browsers (and probably KHTML based
browsers, too, if they've integerated the code) has a bug which causes
the response to always be interpreted as ISO-8859-1 instead of in the
encoding specified by the content-type, xml document or the parent
document.

I sent a mail to Apple's webcore mailing list
<http://lists.apple.com/archives/webcore-dev/2005/Feb/msg00001.html>
and got a reply saying that the bug has been fixed in an unreleased
version of the framework.

How would people feel about cluttering liveevil.js with code for
checking for WebKit versions up to and including the current one, and
attempt to re-interpret the string as UTF-8 if found?

A version check and then something along the lines of _from_utf8() on
<http://homepage3.nifty.com/aokura/jscript/utf8.html> should do it,
but that would add dozens of lines to the beautifully simple script...

/ Sincerely, David



More information about the Twisted-web mailing list