Version: (using KDE KDE 3.1.2) Installed from: Gentoo Packages Compiler: gcc 3.2.3 gcc version 3.2.3 20030422 (Gentoo Linux 1.4 3.2.3-r1, propolice) OS: Linux I am Chinese, and I just find that after uploaded a file whose name contains Chinese characters, on the server running PHP 4.3.2 + apache 1.3.27 all the Chinese characters in the file name changes to "?". I again use Mozilla to upload the same file to the same server, and the result is just correct. I find the problem is caused by the conversion to ascii, in file khtml/html/html_formimpl.cpp in package kdelibs, line 267 hstr += ("; filename=\"" + onlyfilename + "\"").ascii(); I modify it to hstr += ("; filename=\"" + onlyfilename + "\"").local8Bit(); and uploading works fine. Hope you can correct this next version. Thanks.
Created attachment 2081 [details] Makes the file upload use the page encoding instead It should probably use the page's encoding, like other form elements do. Can you please test the attached patch?
It works fine, thanks.
Hold on for a bit, I don't think Thiago commited this yet :-)
Subject: KDE_3_1_BRANCH: kdelibs/khtml/html CVS commit by thiago: Fixing in branch. CCMAIL:61721@bugs.kde.org M +1 -1 html_formimpl.cpp 1.300.2.11 --- kdelibs/khtml/html/html_formimpl.cpp #1.300.2.10:1.300.2.11 @@ -268,5 +268,5 @@ QByteArray HTMLFormElementImpl::formData QString onlyfilename = path.mid(path.findRev('/')+1); - hstr += ("; filename=\"" + onlyfilename + "\"").ascii(); + hstr += fixUpfromUnicode(codec, "; filename=\"" + onlyfilename + "\""); if(!static_cast<HTMLInputElementImpl*>(current)->value().isEmpty()) {
Subject: kdelibs/khtml/html CVS commit by thiago: And fixing in HEAD. Thanks for reporting. CCMAIL:61721-done@bugs.kde.org M +2 -2 html_formimpl.cpp 1.328 --- kdelibs/khtml/html/html_formimpl.cpp #1.327:1.328 @@ -269,5 +269,5 @@ QByteArray HTMLFormElementImpl::formData QString onlyfilename = path.mid(path.findRev('/')+1); - hstr += ("; filename=\"" + onlyfilename + "\"").ascii(); + hstr += fixUpfromUnicode(codec, "; filename=\"" + onlyfilename + "\""); if(!static_cast<HTMLInputElementImpl*>(current)->value().isEmpty()) { KMimeType::Ptr ptr = KMimeType::findByURL(KURL(path));