[Qt-interest] QUrl issue while encoding an already encoded string

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Fri May 14 06:33:02 CEST 2010


> No. Your expectation is wrong. It's a design flaw, not a bug: the constructor
> works as intended, but the intention is wrong.

Oh...so I don't get to report a bug then?! Damn! :P
>
> I told you:
> "Because you used the wrong function. If you have encoded data, you must use
> the functions with "encoded" in the name"
>
> There's no "encoded" in your example. You used the QUrl constructor, which
> calls setUrl. Both the setUrl and the QUrl constructor it overloads say that
> the string you pass is expected to be unencoded:
>
> "url is assumed to be in unicode format, with no percent encoding."
> (http://doc.qt.nokia.com/4.6/qurl.html#setUrl)
>
> Please use QUrl::fromEncoded if you have encoded data you need to place in a
> QUrl.

Thanks for clearing this Thiago.

Regards,
-mandeep

>
> Forget QUrl's constructor, setUrl and toString. Those methods are a design
> flaw. They shouldn't exist, but now we have to put up with them until Qt 5.
>
> --
> Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
>  Senior Product Manager - Nokia, Qt Development Frameworks
>      PGP/GPG: 0x6EF45358; fingerprint:
>      E067 918B B660 DBD1 105C  966C 33F5 F005 6EF4 5358
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>




More information about the Qt-interest-old mailing list