use strict; use warnings; use feature qw( say ); use Encode qw( decode encode ); my $have = "\x84\x71\x79\x84\x7B\x7A\x84\xB7" . "\x7B\x84\x8F\x79\x84\xA3\x7F\x84" . "\x8F\x7E"; my $want = "\x{201E}\x{0071}\x{0079}\x{201E}" . "\x{007B}\x{007A}\x{201E}\x{00B7}" . "\x{007B}\x{201E}\x{008F}\x{0079}" . "\x{201E}\x{00A3}\x{007F}\x{201E}" . "\x{008F}\x{007E}"; for (Encode->encodings(':all')) { my $got; if (!eval { $got = decode($_, $have); 1 }) { warn $@; next; } say if $got eq $want; }