charset: encode webdings font
authorMischa POSLAWSKY <perl@shiar.org>
Fri, 21 Apr 2017 22:19:29 +0000 (00:19 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 25 May 2017 20:10:23 +0000 (22:10 +0200)
Reference: <http://www.alanwood.net/demos/webdings.html>

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

diff --git a/Encode/Webdings.pm b/Encode/Webdings.pm
new file mode 100644 (file)
index 0000000..eb6e487
--- /dev/null
@@ -0,0 +1,22 @@
+package Encode::Webdings;
+
+use 5.014;
+use warnings;
+use utf8;
+
+our $VERSION = '1.00';
+
+use parent 'Encode::Wingdings';
+__PACKAGE__->Define('webdings');
+
+our @MAP = (qw[
+         🕷 🕸 🕲 🕶 🏆 🎖 🖇 🗨 🗩 🗰 🗱 🌶 🎗 ▞ 🙼 🗕 🗖 🗗 ⏴ ⏵ ⏶ ⏷ ⏪ ⏩ ⏮ ⏭ ⏸ ⏹ ⏺ 🗚 🗳
+       🛠 🏗 🏘 🏙 🏚 🏜 🏭 🏛 🏠 🏖 🏝 🛣 🔍 🏔 👁 👂 🏞 🏕 🛤 🏟 🛳 🕬 🕫 🕨 🔈 🎔 🎕 🗬 🙽 🗭 🗪 🗫
+       ⮔ ✔ 🚲 □ 🛡 📦 🛱 ■ 🚑 🛈 🛩 🛰 🟈 🕴 ⚫ 🛥 🚔 🗘 🗙 ❓ 🛲 🚇 🚍 ⛳ 🛇 ⊖ 🚭 🗮 | 🗯 🗲 \7f
+       🚹 🚺 🛉 🛊 🚼 👽 🏋 ⛷ 🏂 🏌 🏊 🏄 🏍 🏎 🚘 🗠 🛢 💰 🏷 💳 👪 🗡 🗢 🗣 ✯ 🖄 🖅 🖃 🖆 🖹 🖺 🖻
+       🕵 🕰 🖽 🖾 📋 🗒 🗓 📖 📚 🗞 🗟 🗃 🗂 🖼 🎭 🎜 🎘 🎙 🎧 💿 🎞 📷 🎟 🎬 📽 📹 📾 📻 🎚 🎛 📺 💻
+       🖥 🖦 🖧 🕹 🎮 🕻 🕼 📟 🖁 🖀 🖨 🖩 🖿 🖪 🗜 🔒 🔓 🗝 📥 📤 🕳 🌣 🌤 🌥 🌦 ☁ 🌧 🌨 🌩 🌪 🌬 🌫
+       🌜 🌡 🛋 🛏 🍽 🍸 🛎 🛍 Ⓟ ♿ 🛆 🖈 🎓 🗤 🗥 🗦 🗧 🛪 🐿 🐦 🐟 🐕 🐈 🙬 🙮 🙭 🙯 🗺 🌍 🌏 🌎 🕊
+]);
+
+1;
index df06b86e32f2acb0880447b5dca6c15b0a938dff..cb553dd1e459a8002226f12ba3273f869fd7dbb2 100644 (file)
@@ -1,6 +1,7 @@
 package Encode::Wingdings;
 
 use 5.014;
+no strict 'refs';
 use warnings;
 use utf8;
 
@@ -23,7 +24,7 @@ sub decode ($$;$) {
        my ($self, $input, $check) = @_;
        my $output = '';
        for (unpack 'C*', $input) {
-               $output .= $_ < 33 ? chr : $MAP[$_ - 33];
+               $output .= $_ < 33 ? chr : ${ref($self).'::MAP'}[$_ - 33];
        }
        return $output;
 }
index 25bc44b6e14ac26f77b98ff3a08be0da33e91fd3..be3165542f036d94abf8e9979bfd494e48425444 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 )],
+               symbols    => [qw( symbol dingbats MacDingbats wingdings 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'],
+                       'webdings'    => ['' => '32'],
 
                        'iso-8859-2'  => ['iso-8859-1' => '160'],
                        'iso-8859-3'  => ['iso-8859-1' => '160'], #TODO: also apply to iso-8859-9
@@ -253,8 +254,8 @@ sub tabinput {
                }
        }
 
-       if (lc $input eq 'wingdings') {
-               require Encode::Wingdings;
+       if ($input =~ m{ \A (?:wing|web)dings \z }ix) {
+               require "Encode/\u$input.pm";
        }
 
        if ($input =~ m{ \A u ([0-9a-f]+) (?:-([0-9a-f]+))? \z }ix) {