charset: encode wingdings2 font
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 21 Apr 2017 20:05:52 +0000 (22:05 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 25 May 2017 20:10:23 +0000 (22:10 +0200)
Reference: <http://www.alanwood.net/demos/wingdings-2.html>

Encode/Wingdings.pm
Encode/Wingdings2.pm [new file with mode: 0644]
charset.plp

index cb553dd..f63ec04 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;
 }
diff --git a/Encode/Wingdings2.pm b/Encode/Wingdings2.pm
new file mode 100644 (file)
index 0000000..cf70296
--- /dev/null
@@ -0,0 +1,22 @@
+package Encode::Webdings2;
+
+use 5.014;
+use warnings;
+use utf8;
+
+our $VERSION = '1.00';
+
+use parent 'Encode::Wingdings';
+__PACKAGE__->Define('wingdings2');
+
+our @MAP = (qw[
+         ๐Ÿ–Š ๐Ÿ–‹ ๐Ÿ–Œ ๐Ÿ– โœ„ โœ€ ๐Ÿ•พ ๐Ÿ•ฝ ๐Ÿ—… ๐Ÿ—† ๐Ÿ—‡ ๐Ÿ—ˆ ๐Ÿ—‰ ๐Ÿ—Š ๐Ÿ—‹ ๐Ÿ—Œ ๐Ÿ— ๐Ÿ“‹ ๐Ÿ—‘ ๐Ÿ—” ๐Ÿ–ต ๐Ÿ–ถ ๐Ÿ–ท ๐Ÿ–ธ ๐Ÿ–ญ ๐Ÿ–ฏ ๐Ÿ–ฑ ๐Ÿ–’ ๐Ÿ–“ ๐Ÿ–˜ ๐Ÿ–™
+       ๐Ÿ–š ๐Ÿ–› ๐Ÿ‘ˆ ๐Ÿ‘‰ ๐Ÿ–œ ๐Ÿ– ๐Ÿ–ž ๐Ÿ–Ÿ ๐Ÿ–  ๐Ÿ–ก ๐Ÿ‘† ๐Ÿ‘‡ ๐Ÿ–ข ๐Ÿ–ฃ ๐Ÿ–‘ ๐Ÿ—ด โœ“ ๐Ÿ—ต โ˜‘ โ˜’ โ˜’ โฎพ โฎฟ โฆธ โฆธ ๐Ÿ™ฑ ๐Ÿ™ด ๐Ÿ™ฒ ๐Ÿ™ณ โ€ฝ ๐Ÿ™น ๐Ÿ™บ
+       ๐Ÿ™ป ๐Ÿ™ฆ ๐Ÿ™ค ๐Ÿ™ฅ ๐Ÿ™ง ๐Ÿ™š ๐Ÿ™˜ ๐Ÿ™™ ๐Ÿ™› โ“ช โ‘  โ‘ก โ‘ข โ‘ฃ โ‘ค โ‘ฅ โ‘ฆ โ‘ง โ‘จ โ‘ฉ โ“ฟ โถ โท โธ โน โบ โป โผ โฝ โพ โฟ \7f
+       โ˜‰ ๐ŸŒ• โ˜ฝ โ˜พ โธฟ โœ ๐Ÿ•‡ ๐Ÿ•œ ๐Ÿ• ๐Ÿ•ž ๐Ÿ•Ÿ ๐Ÿ•  ๐Ÿ•ก ๐Ÿ•ข ๐Ÿ•ฃ ๐Ÿ•ค ๐Ÿ•ฅ ๐Ÿ•ฆ ๐Ÿ•ง ๐Ÿ™จ ๐Ÿ™ฉ โ€ข โ— โšซ โฌค ๐Ÿž… ๐Ÿž† ๐Ÿž‡ ๐Ÿžˆ ๐ŸžŠ โฆฟ โ—พ
+       โ–  โ—ผ โฌ› โฌœ ๐Ÿž‘ ๐Ÿž’ ๐Ÿž“ ๐Ÿž” โ–ฃ ๐Ÿž• ๐Ÿž– ๐Ÿž— โฌฉ โฌฅ โ—† โ—‡ ๐Ÿžš โ—ˆ ๐Ÿž› ๐Ÿžœ ๐Ÿž โฌช โฌง โงซ โ—Š ๐Ÿž  โ—– โ—— โฏŠ โฏ‹ โ—ผ โฌฅ
+       โฌŸ โฏ‚ โฌฃ โฌข โฏƒ โฏ„ ๐Ÿžก ๐Ÿžข ๐Ÿžฃ ๐Ÿžค ๐Ÿžฅ ๐Ÿžฆ ๐Ÿžง ๐Ÿžจ ๐Ÿžฉ ๐Ÿžช ๐Ÿžซ ๐Ÿžฌ ๐Ÿžญ ๐Ÿžฎ ๐Ÿžฏ ๐Ÿžฐ ๐Ÿžฑ ๐Ÿžฒ ๐Ÿžณ ๐Ÿžด ๐Ÿžต ๐Ÿžถ ๐Ÿžท ๐Ÿžธ ๐Ÿžน ๐Ÿžบ
+       ๐Ÿžป ๐Ÿžผ ๐Ÿžฝ ๐Ÿžพ ๐Ÿžฟ ๐ŸŸ€ ๐ŸŸ‚ ๐ŸŸ„ โœฆ ๐ŸŸ‰ โ˜… โœถ ๐ŸŸ‹ โœท ๐ŸŸ ๐ŸŸ’ โœน ๐ŸŸƒ ๐ŸŸ‡ โœฏ ๐ŸŸ ๐ŸŸ” โฏŒ โฏ โ€ป โ‚
+]);
+
+1;
index be31655..7891ee3 100644 (file)
@@ -105,7 +105,7 @@ sub tabinput {
                hebrew     => [qw( iso-8859-8 cp1255 MacHebrew cp862  U59-5F )],
                thai       => [qw( iso-8859-11 cp874 MacThai )],
                vietnamese => [qw( viscii cp1258 MacVietnamese )],
-               symbols    => [qw( symbol dingbats MacDingbats wingdings webdings )],
+               symbols    => [qw( symbol dingbats MacDingbats wingdings wingdings2 webdings )],
 
                # iso-code shorthand
                1 => 'westeur',
@@ -139,6 +139,7 @@ sub tabinput {
                        'symbol'      => ['' => '32-127+160'],
                        'AdobeSymbol' => ['symbol' => '32-127+160', '' => '32-127+160'], # minor differences, irrelevant except for different 'โ‚ฌ'
                        'wingdings'   => ['' => '32'],
+                       'wingdings2'  => ['' => '32'],
                        'webdings'    => ['' => '32'],
 
                        'iso-8859-2'  => ['iso-8859-1' => '160'],
@@ -254,8 +255,8 @@ sub tabinput {
                }
        }
 
-       if ($input =~ m{ \A (?:wing|web)dings \z }ix) {
-               require "Encode/\u$input.pm";
+       if ($input =~ m{ \A (?:wing|web)dings \d* \z }ix) {
+               eval "require Encode::\u$input";
        }
 
        if ($input =~ m{ \A u ([0-9a-f]+) (?:-([0-9a-f]+))? \z }ix) {