I think you might be looking for the solution others provided me just recently for almost the exact same issue. In my case, the trick turned out to be a two-step process. You will find the details to the solution here:
Perl's encoding versus UTF8 octetsThe crux of it was this:
$mytext =~ s!\\x(..)!chr(hex($1))!ge; my $newcode = decode('utf8', $mytext);
Note the substitution followed by the decode.
Blessings,
~Polyglot~
In reply to Re: Re \x {} junk
by Polyglot
in thread Getting rid of \x junk
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |