=htc Fix handling of non-BMP characters in URI encoding/decoding, closes #16014

Also improved the tests for this as they were sub-par so far
Merge pull request #16015 from spray/wip-16014-mathias

=htc Fix handling of non-BMP characters in URI encoding/decoding