You can use
perl's pack function to do that
$hex_ascii=%20;
print "HEX $hex_ascii\n";
$hex_ascii =~ s/%(..)/pack("c",hex($1))/ge;
print "Alpha $hex_ascii\n";
Code above may not suit exactly what you're looking for, but hopefully points in the right direction
, Mike