On quarta-feira, 14 de agosto de 2013 00:35:47, Richard Turner wrote: > OK. Now the problem is, when I use downloadUrl1(result from fromEncoded) > to make a QNetworkRequest (HTTP GET), I always detect an error: Protocol > "" is unknown. > When I switch to use downloadUrl2, all is good.
That was expected. Look at what your URL was: 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 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 unknown". 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. -- Thiago Macieira - thiago.macieira (AT) intel.com Software Architect - Intel Open Source Technology Center
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest