QUrl stringprep: recalculate the current position if the size changes

If the case folding operation results in either expansion or reduction
of the string, we need to adapt. Reduction happens most often when a
non-BMP character is case-folded to a character in the BMP (example:
mathematical signs at U+1D400-1D7FF). Expansion happens in the rare
case of symbols containing words, like U+2121 ℡ (this is part of the
unit test), and one common case: the German sharp S (ß) is expanded to
"ss".

(cherry-picked from qtbase commit 2ccf4c32cc593f568581dd237e1e27d39fd965a2)
Change-Id: I1bdbdc908b958a89bf30e4bb648d65dfdd9097f8
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
QUrl stringprep: fix case folding from non-BMP to BMP

When uc > 0xffff (non-BMP character) and l == 1 (replacement is in the
BMP), we must use QString::replace so the correct number of characters
is replaced.

There's one case testing this in tst_qurl, but it is being
obscured by another bug (false positive).

(cherry-picked from qtbase commit 86312275197c3fde948035a59c0358162701f9f2)
Change-Id: I32388dd5bef32d4d6804aeeec4904bd5f563e9b9
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
QUrl stringprep: fix handling of prohibited characters

RFC 3454 says about prohibited characters (section 2, "Preparation
Overview"):

   3) Prohibit -- Check for any characters that are not allowed in the
      output.  If any are found, return an error.  This is described in
      section 5.

In other words, we mustn't simply strip the output of prohibited
characters. We must generate an error if they are present. We do that by
clearing the data.

We already had tests for prohibited output, but they were
indistinguishable from being stripped. So instead add some extra
characters so that we can tell whether the label was cleared.

(cherry-picked from qtbase commit 736a052d93d9c75e51e8f3da733bc8e4a50c39ce)
Change-Id: I2d95217c27be5e2d54deed0036cb009e3b7f4886
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
QUrl stringprep: avoid recalculating the surrogates we already know

(cherry-picked from qtbase commit 53388cd8e0451ea375ed250b59f9e89319fb3e1c)
Change-Id: Icac4e81fff6f7f7fa4f46ec2a08105f8d3d2b403
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
QUrl stringprep: fix handling of U+0080: it's prohibited

Edge case: a > that should have been >=. Without it, we never ran the
rest of the IDN nameprepping.

(cherry-picked from qtbase commit 4d93393a6de2d6631979df2bc6d12aa43781dc6f)
Change-Id: I2276d660de3a70d0c561bb18816820d9a0f47e77
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>