charset: encode wingdings2 font
[sheet.git] / Encode / Wingdings.pm
index cb553dd1e459a8002226f12ba3273f869fd7dbb2..f63ec04b951e85f76953e61c850b16af0fca602b 100644 (file)
@@ -20,11 +20,13 @@ our @MAP = (qw[
        🡪 🡩 🡫 🡬 🡭 🡯 🡮 🡸 🡺 🡹 🡻 🡼 🡽 🡿 🡾 ⇦ ⇨ ⇧ ⇩ ⬄ ⇳ ⬀ ⬁ ⬃ ⬂ 🢬 🢭 🗶 ✔ 🗷 🗹 
 ]);
 
+our $NOCHAR = '�';
+
 sub decode ($$;$) {
        my ($self, $input, $check) = @_;
        my $output = '';
        for (unpack 'C*', $input) {
-               $output .= $_ < 33 ? chr : ${ref($self).'::MAP'}[$_ - 33];
+               $output .= $_ < 33 ? chr : ${ref($self).'::MAP'}[$_ - 33] // $NOCHAR;
        }
        return $output;
 }