[Qt-interest] QWebPage: percent encoded query items use Latin1 instead of UTF-8 ?
Joachim Förster
JOFT at gmx.de
Sun Jan 16 21:39:03 CET 2011
Hi Thiago,
Thiago Macieira wrote:
> On Sunday, 16 de January de 2011 20:44:46 Joachim Förster wrote:
>> The big question is: Why did the encoding change? As far as I understand
>> the Qt source code (qurl.cpp) it should stay percent-encoded-UTF-8.
>>
>> Am I doing something wrong? Or is this a bug in Qt?
>>
>> I'm currently using Qt 4.7.1 .
>
> Form items in HTML are encoded according to the page's encoding. What is your
> page's encoding?
I'm using UTF-8 - at least think so.
I subclassed QNetworkReply and QNetworkAccessManager. In my custom
AccessManager' createRequest() I'm returning my custom Reply (for a
custom scheme). In this custom Reply I implement readData(), which fills
it's data buffer with content.toUtf8().data() ("content" is the QString,
which contains the generated HTML source code I mentioned before.)
You mentioned form items. In fact, I do not have a form on this page,
it's a plain link like:
<a href="myscheme://foo/bar?item=%C3%9CBER">myLink</a>
If the user clicks on such a link, I get
request.url().encodedQueryItemValue("item") == "%DCBER"
Thanks for your answer,
Joachim
More information about the Qt-interest-old
mailing list