Converting %## back to special characters from an HTML form

I have an HTML form that sends email to a large list of users one at a time by matching an email address in peoplesoft to their username. It works great, except that special characters are converted to %## format. Is there a library of these I can use to sed them back (yes this is a crappy UNIX shell cgi, bash) to the correct character, or a simple perl script that will do it?

For Perl,

$str =~ s/%([0-9A-Fa-f]{2})/chr(hex($1))/eg;

will convert all URL-encoded entities in $str back to the corresponding character.