use Encode; # ... get the uri string into $_ by whatever means ... $_ = "a%20%C3%A5%20%2F"; # first, let's turn the uri encoded string (with "%HH" for some bytes) into binary: s/\%([0-9a-f]{2})/chr(hex($1))/egi; # then, since this produces a utf-8 byte sequence, let's "decode" that into utf-8 $_ = decode( 'utf8', $_ ); # $_ now has utf8 flag set, and contains the string with expected unicode characters binmode STDOUT, ":utf8"; print;