Fixed #22223 -- Prevented over-escaping URLs in reverse()

And follow more closely the class of characters defined in the
RFC 3986.
Thanks Erik van Zijst for the report and the initial patch.
Do you have more stupid questions like this :-) ?
Frankly, it's still a bit mysterious for me. RFC3986_GENDELIMS is completely in, then part of RFC3986_SUBDELIMS (missing: `!'()*`) + some other chars : `_"<>%\`