We are porting our project from qt 4.8 to 5.0.2 and have run in to a problem with how the '+' character is encoded and decoded in the QUrl. An example URL is like this:
QString url = https://testurl.net/gf%2Fe51f1774%2FTKIsnXER5yHjPSj9h9N5W9qexRRaZ1NEOkdOdqF%2FYNht6fwqs%2Fnq0edOKoMJ26UKwu44ww3n7Y6d%0ACewL43WiP1LrJUYYTEv3YusoRZfv4BY3L%2FdF2gKQpJh4AkF%2B8P1FD2Ftl7DztJT7v
I pass this URL in to a QUrl constructor via:
const QUrl qurl (QUrl::fromEncoded ( url.toUtf8 () ));
The issue is that when I look at the request go out on the wire I see this:
You can see at the end of the URL %2B has been replaced with + which is no longer a valid URL for us. I see the + when I call QUrl.toString(QUrl::None) as well.
In QT 4.8.4 the above works correctly, meaning that the QUrl encodes the + sign back to %2B when making the actual network request.
I noticed in the QT 5.0 documentation that the QUrlQuery class talks about how a + is not encoded or decoded so I'm wondering if this affecting a + found in the non-query portion of the url.
- is required for
QTBUG-31945 OSX: QDesktopServices fails to open some urls.