use strict; use warnings; use feature qw( say ); use Encode qw( decode encode_utf8 ); 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}"; my $got = decode('cp1252', $have, sub { encode_utf8(chr($_[0])) }); say "match" if $got eq $want;