Fix #20022: Correctly handle prefixes with url-unsafe characters in reverse().
Merge pull request #900 from bmispelon/ticket-20022

Fix #20022: Correctly handle prefixes with url-unsafe characters in reverse()