Version: 3.5.3 (using KDE 3.5.3, compiled sources) Compiler: gcc version 3.4.6 OS: Linux (i686) release 2.4.31 Might be related to #130234, not sure. XmlHttpRequests containing UTF-8 POST data are not sent correctly. A simple testcase is available here: http://www.robertjohnkaper.com/tmp/kio_utf8.html Works fine in Firefox, but Konqueror messes up and loses input data.
Version: 3.5.3 (using KDE 3.5.3) Compiler: gcc (GCC) 3.4.5 (Gentoo 3.4.5, ssp-3.4.5-1.0, pie-8.7.9) OS: Linux i686 2.6.17-ck1-r2 #1 PREEMPT Same problem here with german "Umlaute". Seems to me as there runs something wrong when konqueror calculates the string length of the utf-8 encoded string. Same problem occures in Safari-2.0.4 if in the request the content-type header is set to something different from "text/javascript".
Duplicate bug #119391
Created attachment 17476 [details] Patch (fixes test case for me) Attached patch fixes the issue for me
Patch fixes issue for me too.
SVN commit 576640 by ggarand: apply patch by James Thorniley<james_thorniley@yahoo.co.uk> for "xmlhttprequest breaks on utf-8 strings" BUG:131242 M +1 -1 xmlhttprequest.cpp --- branches/KDE/3.5/kdelibs/khtml/ecma/xmlhttprequest.cpp #576639:576640 @@ -335,7 +335,7 @@ // FIXME: determine post encoding correctly by looking in headers // for charset. QByteArray buf; - buf.duplicate(_body.utf8().data(), _body.length()); + buf.duplicate(_body.utf8().data(), _body.utf8().length()); job = KIO::http_post( url, buf, false ); if(contentType.isNull())
SVN commit 576656 by dfaure: Calling utf8() twice is expensive, calling length() on a QCString is expensive, so better not do either one :) CCBUG: 131242 M +2 -1 xmlhttprequest.cpp --- branches/KDE/3.5/kdelibs/khtml/ecma/xmlhttprequest.cpp #576655:576656 @@ -335,7 +335,8 @@ // FIXME: determine post encoding correctly by looking in headers // for charset. QByteArray buf; - buf.duplicate(_body.utf8().data(), _body.utf8().length()); + QCString str = _body.utf8(); + buf.duplicate(str.data(), str.size() - 1); job = KIO::http_post( url, buf, false ); if(contentType.isNull())