QUrl: update our understanding of the encoding of delimiters

The longer explanation can be found in the comment in qurl.cpp. The
short version is as follows:

Up to now, we considered that every character could be replaced with
its percent-encoding equivalent and vice-versa, so long as the parsing
of the URL did not change. For example, x:/path+path and
x:/path%2Bpath were the same. However, to do this and yet be compliant
with most URL uses in the real world, we had to add exceptions:
 - "/" and "%2F" were not the same in the path, despite the delimiter
   being behind (rationale was the complex definition of path)
 - "+" and "%2B" were not the same in the query, so we ended up not
   transforming any sub-delim in the query at all

Now, we change our understanding based on the following line from
RFC 3986 section 2.2:
   URIs that differ in the replacement of a reserved character with
   its corresponding percent-encoded octet are not equivalent.

From now on, QUrl will not replace any sub-delim or gen-delim
("reserved character"), except where such a character could not exist
in the first place. This simplifies the code and removes all
exceptions.

As a side-effect, this has also changed the behaviour of the "{" and
"}" characters, which we previously allowed to remain decoded.

[ChangeLog][Important Behavior Changes][QUrl and QUrlQuery] QUrl no
longer considers all delimiter characters equivalent to their
percent-encoded forms. Now, both classes always keep all delimiters
exactly as they were in the original URL text.

[ChangeLog][Important Behavior Changes][QUrl and QUrlQuery] QUrl no
longer decodes %7B and %7D to "{" and "}" in the output of toString()

Task-number: QTBUG-31660
Change-Id: Iba0b5b31b269635ac2d0adb2bb0dfb74c139e08c
Reviewed-by: David Faure (KDE) <faure@kde.org>
QUrlQuery: update our understanding of delimiters

This commit is similar to the previous commit that changed the behavior
of QUrl, but now to QUrlQuery.

We can now remove a section of qt_urlDecode, which is no longer used:
there's no "decode everything" mode anymore.

Task-number: QTBUG-31660
Change-Id: I66cfbfd290eeba5b04688cd5ffd615dd57cc6309
Reviewed-by: David Faure (KDE) <faure@kde.org>
Doc: update the QUrl and QUrlQuery documentation

Just minor fixes and changes in wording, to support the new
understanding of the percent-encoded characters.

Change-Id: I77ec10e41f32292d705e4aa8197b9ddce5bef6d2
Reviewed-by: David Faure (KDE) <faure@kde.org>
QUrl: remove temporary code

The setting of EncodeDelimiters was temporary until we could remove the
old qt_urlRecode "decode all" mode (not the FullyDecoded mode, that
stays).

Change-Id: Ic07ebe4bb7fc72351b65bfb4619b71206cc8c0cd
Reviewed-by: David Faure (KDE) <faure@kde.org>
Remove fully-decoded QUrl user info and authority sections

Those sections contain more than one components of a URL, separated by
delimiters. For that reason, QUrl::FullyDecoded and QUrl::DecodedMode do
not make sense, since they would cause the returned value to be
ambiguous and/or fail to parse again.

In fact, there was a comment in the test saying "look how it becomes
ambiguous".

Those modes are already forbidden in the setters and getters of the full
URL (setUrl(), url(), toString() and toEncoded()).

[ChangeLog][Important Behavior Changes][QUrl and QUrlQuery] QUrl no
longer supports QUrl::FullyDecoded mode in authority() and userInfo(),
nor QUrl::DecodedMode in setAuthority() and setUserInfo().

Change-Id: I538f7981a9f5a09f07d3879d31ccf6f0c8bfd940
Reviewed-by: David Faure (KDE) <faure@kde.org>
Make sure that QUrl::FullyDecoded mode uses U+FFFD for bad UTF-8

It's a good practice to always replace bad UTF-8 sequences with the
replacement character. It could be considered a security issue too.

Change-Id: I9e7d72e4c4102cdb8334449b5e7f882228a9048f
Reviewed-by: David Faure (KDE) <faure@kde.org>
QUrl: do not decode "#" in fragments

For some time, we've assumed that the URL specification had a mistake in
that it didn't allow the "#" character to appear decoded in the
fragment. We've gotten away with it so far.

However, turns out that the CoreFoundation NSURL class doesn't like it.
So we have to be stricter.

[ChangeLog][Important Behavior Changes][QUrl and QUrlQuery] QUrl no
longer decodes %23 found in the fragment to "#" in the output of
toString(QUrl::FullyEncoded) or toEncoded()

Task-number: QTBUG-31945
Change-Id: If5e0fb37bae84710986c9ca89bd69ec98437cd63
Reviewed-by: David Faure (KDE) <faure@kde.org>