[Interest] Difference between QUrl::fromEncoded and QUrl::fromPercentEncoding ?
Richard Turner
turner at yiran.org
Tue Aug 13 12:44:41 CEST 2013
|Hi,
| QString str = "http%3A%2F%2F192.168.1.1%3A80%2Fservlet%2Fcom.mcdonalds.report.view.excel.ExcelReportServlet%3Ffile%3D4162%26columns%3D0%26srcType%3DdefineBean%26width%3D0%26height%3D0%26reportParamsId%3D101767%26cachedId%3D4163%26t_i_m_e%3D1376389959473&pageStyle=0";
QUrl downloadUrl1 = QUrl::fromEncoded(str.toUtf8());
QUrl downloadUrl2 = QUrl::fromPercentEncoding(str.toUtf8());
assert(downloadUrl1.toString() == downloadUrl2.toString());
assert(downloadUrl1 == downloadUrl2);
Why is the second assertion fails when the first assertion still passes? What is the underlying difference between QUrl::fromEncoded and QUrl::fromPercentEncoding?
Thanks!
Richard
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20130813/5ad432db/attachment.html>
More information about the Interest
mailing list