in reply to Decoding part of URL

This will not produce a decoded text string for non-latin1 chars in the URLs.

I'd recommend one of the various CGI modules out there, they are usually very well tested and provide such functionality.