my $a = "\\xC4\\x80"; $a =~ s/\\x([0-9A-Fa-f]+)/chr(hex($1))/ge; utf8::decode($a); printf "length=%d, ord=0x%x\n", length($a), ord($a);