[Interest] QWebFrame::toHtml() is encoding <> automatically

Aaron Lewis the.warl0ck.1989 at gmail.com
Tue Apr 2 16:00:31 CEST 2013


Hi Richard!

Nope, content-type isn't the case here, even if I provide a

header ("Content-Type: text/html");

It doesn't make any change.

On Tue, Apr 2, 2013 at 8:01 PM, Richard Moore <rich at kde.org> wrote:
> On 2 April 2013 12:36, Aaron Lewis <the.warl0ck.1989 at gmail.com> wrote:
>> Below is a testing php script,
>>
>> <?php
>>     echo $_GET['abc'], "<br/>";
>>     echo htmlentities($_GET['abc']);
>> ?>
>>
>> If I retrieve the contents of that page with chromium browser, showing
>> the source code reveals contents like this:
>>
>> <><br/><>
>>
>> But with QWebFrame::toHtml(), all <> are encoded, and I got:
>>
>> <html><head></head><body><><br><> </body></html>
>>
>> That's weird, anyone know how to "stop" QtWebkit from encoding them?
>
> Your script is sending completely invalid HTML, and from the looks of
> it not setting the content type. This means you should expect the
> results to be completely undefined. In this case, it looks as if
> QtWebkit is treating it as plain text, wheras I can't even tell what
> chromium is treating it as!
>
> Regards
>
> Rich.
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest



--
Best Regards,
Aaron Lewis - PGP: 0xDFE6C29E ( http://keyserver.veridis.com )
Finger Print: 9482 448F C7C3 896C 1DFE 7DD3 2492 A7D0 DFE6 C29E



More information about the Interest mailing list