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

Closes #16014 by porting (improved versions) of these spray PRs:

- https://github.com/spray/spray/pull/855
- https://github.com/spray/spray/pull/856
Good that you ask, I was looking for it and somehow couldn't find it anymore.
Honestly!
Please re-supply me with one, so I can store it away safely this time!