Description
After the following call on a QUrl instance url:
url.addQueryItem("test", "plus+and space");
one would expect the resulting url instance to procude an encoded query like this:
...&test=plus%2Band%20space
Or, following the convention to encode spaces as '+' in encoded queries, one might expect that:
...&test=plus%2Band+space
However, the current QUrl implementation does none of the above. Instead, it generates:
...&test=plus+and%20space
This is wrong, and most web applications will decode that test parameter as "plus and space". So the QUrl::addQueryItem() method effectively converts all '+' characters to spaces.
Additional note: The method QUrl::toPercentEncoding() works correctly in this regard. So the following code:
url.addEncodedQueryItem("id", QUrl::toPercentEncoding("plus+and space"));
will produce a correct result:
...&test=plus%2Band%20space