[Interest] Difference between QUrl::fromEncoded and QUrl::fromPercentEncoding ?
turner at yiran.org
Tue Aug 13 23:30:44 CEST 2013
On 2013/8/14 1:50, Thiago Macieira wrote:
> That was expected. Look at what your URL was:
> Try pasting that in a browser and see what happens.
> The behaviour differs because QUrl::fromEncoded tries to interpret that as a
> URL. It has no scheme, so the entire thing is the path of the URL. Since it
> has no scheme, QNetworkAccessManager is correct in saying that "Protocol '' is
> QUrl::fromPercentEncoding does no interpretation. It simply decodes the
> percents. After that, you call the QUrl constructor on a different URL. Let me
> repeat: on a *different* URL.
Thank you very much Thiago!
Just one more question: could you elaborate on the idea that calling the
QUrl constructor taking a QString is a big no-no in Qt 4 code, but not
in Qt 5?
More information about the Interest