From: Mischa POSLAWSKY Date: Sat, 22 Apr 2017 15:55:53 +0000 (+0200) Subject: charset: inline symbol character tables X-Git-Tag: v1.10~87 X-Git-Url: http://git.shiar.nl/sheet.git/commitdiff_plain/902eb27b5902755d9ab891d85fa5febfd6fd69e9 charset: inline symbol character tables Set arrays directly instead of bothering with Encode conversion. --- diff --git a/Encode/Webdings.pm b/Encode/Webdings.pm deleted file mode 100644 index eb6e487..0000000 --- a/Encode/Webdings.pm +++ /dev/null @@ -1,22 +0,0 @@ -package Encode::Webdings; - -use 5.014; -use warnings; -use utf8; - -our $VERSION = '1.00'; - -use parent 'Encode::Wingdings'; -__PACKAGE__->Define('webdings'); - -our @MAP = (qw[ - 🕷 🕸 🕲 🕶 🏆 🎖 🖇 🗨 🗩 🗰 🗱 🌶 🎗 ▞ 🙼 🗕 🗖 🗗 ⏴ ⏵ ⏶ ⏷ ⏪ ⏩ ⏮ ⏭ ⏸ ⏹ ⏺ 🗚 🗳 - 🛠 🏗 🏘 🏙 🏚 🏜 🏭 🏛 🏠 🏖 🏝 🛣 🔍 🏔 👁 👂 🏞 🏕 🛤 🏟 🛳 🕬 🕫 🕨 🔈 🎔 🎕 🗬 🙽 🗭 🗪 🗫 - ⮔ ✔ 🚲 □ 🛡 📦 🛱 ■ 🚑 🛈 🛩 🛰 🟈 🕴 ⚫ 🛥 🚔 🗘 🗙 ❓ 🛲 🚇 🚍 ⛳ 🛇 ⊖ 🚭 🗮 | 🗯 🗲  - 🚹 🚺 🛉 🛊 🚼 👽 🏋 ⛷ 🏂 🏌 🏊 🏄 🏍 🏎 🚘 🗠 🛢 💰 🏷 💳 👪 🗡 🗢 🗣 ✯ 🖄 🖅 🖃 🖆 🖹 🖺 🖻 - 🕵 🕰 🖽 🖾 📋 🗒 🗓 📖 📚 🗞 🗟 🗃 🗂 🖼 🎭 🎜 🎘 🎙 🎧 💿 🎞 📷 🎟 🎬 📽 📹 📾 📻 🎚 🎛 📺 💻 - 🖥 🖦 🖧 🕹 🎮 🕻 🕼 📟 🖁 🖀 🖨 🖩 🖿 🖪 🗜 🔒 🔓 🗝 📥 📤 🕳 🌣 🌤 🌥 🌦 ☁ 🌧 🌨 🌩 🌪 🌬 🌫 - 🌜 🌡 🛋 🛏 🍽 🍸 🛎 🛍 Ⓟ ♿ 🛆 🖈 🎓 🗤 🗥 🗦 🗧 🛪 🐿 🐦 🐟 🐕 🐈 🙬 🙮 🙭 🙯 🗺 🌍 🌏 🌎 🕊 -]); - -1; diff --git a/Encode/Wingdings.pm b/Encode/Wingdings.pm deleted file mode 100644 index f63ec04..0000000 --- a/Encode/Wingdings.pm +++ /dev/null @@ -1,34 +0,0 @@ -package Encode::Wingdings; - -use 5.014; -no strict 'refs'; -use warnings; -use utf8; - -our $VERSION = '1.00'; - -use parent 'Encode::Encoding'; -__PACKAGE__->Define('wingdings'); - -our @MAP = (qw[ - 🖉 ✂ ✁ 👓 🕭 🕮 🕯 🕿 ✆ 🖂 🖃 📪 📫 📬 📭 📁 📂 📄 🗏 🗐 🗄 ⌛ 🖮 🖰 🖲 🖳 🖴 🖫 🖬 ✇ ✍ - 🖎 ✌ 👌 👍 👎 ☜ ☞ ☝ ☟ 🖐 ☺ 😐 ☹ 💣 ☠ 🏳 🏱 ✈ ☼ 💧 ❄ 🕆 ✞ 🕈 ✠ ✡ ☪ ☯ ॐ ☸ ♈ ♉ - ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓ 🙰 🙵 ● 🔾 ■ □ 🞐 ❑ ❒ ⬧ ⧫ ◆ ❖ ⬥ ⌧ ⮹ ⌘ 🏵 🏶 🙶 🙷  - ⓪ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⓿ ❶ ❷ ❸ ❹ ❺ ❻ ❼ ❽ ❾ ❿ 🙢 🙠 🙡 🙣 🙞 🙜 🙝 🙟 · • - ▪ ⚪ 🞆 🞈 ◉ ◎ 🔿 ▪ ◻ 🟂 ✦ ★ ✶ ✴ ✹ ✵ ⯐ ⌖ ⟡ ⌑ ⯑ ✪ ✰ 🕐 🕑 🕒 🕓 🕔 🕕 🕖 🕗 🕘 - 🕙 🕚 🕛 ⮰ ⮱ ⮲ ⮳ ⮴ ⮵ ⮶ ⮷ 🙪 🙫 🙕 🙔 🙗 🙖 🙐 🙑 🙒 🙓 ⌫ ⌦ ⮘ ⮚ ⮙ ⮛ ⮈ ⮊ ⮉ ⮋ 🡨 - 🡪 🡩 🡫 🡬 🡭 🡯 🡮 🡸 🡺 🡹 🡻 🡼 🡽 🡿 🡾 ⇦ ⇨ ⇧ ⇩ ⬄ ⇳ ⬀ ⬁ ⬃ ⬂ 🢬 🢭 🗶 ✔ 🗷 🗹  -]); - -our $NOCHAR = '�'; - -sub decode ($$;$) { - my ($self, $input, $check) = @_; - my $output = ''; - for (unpack 'C*', $input) { - $output .= $_ < 33 ? chr : ${ref($self).'::MAP'}[$_ - 33] // $NOCHAR; - } - return $output; -} - -1; diff --git a/Encode/Wingdings2.pm b/Encode/Wingdings2.pm deleted file mode 100644 index cf70296..0000000 --- a/Encode/Wingdings2.pm +++ /dev/null @@ -1,22 +0,0 @@ -package Encode::Webdings2; - -use 5.014; -use warnings; -use utf8; - -our $VERSION = '1.00'; - -use parent 'Encode::Wingdings'; -__PACKAGE__->Define('wingdings2'); - -our @MAP = (qw[ - 🖊 🖋 🖌 🖍 ✄ ✀ 🕾 🕽 🗅 🗆 🗇 🗈 🗉 🗊 🗋 🗌 🗍 📋 🗑 🗔 🖵 🖶 🖷 🖸 🖭 🖯 🖱 🖒 🖓 🖘 🖙 - 🖚 🖛 👈 👉 🖜 🖝 🖞 🖟 🖠 🖡 👆 👇 🖢 🖣 🖑 🗴 ✓ 🗵 ☑ ☒ ☒ ⮾ ⮿ ⦸ ⦸ 🙱 🙴 🙲 🙳 ‽ 🙹 🙺 - 🙻 🙦 🙤 🙥 🙧 🙚 🙘 🙙 🙛 ⓪ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⓿ ❶ ❷ ❸ ❹ ❺ ❻ ❼ ❽ ❾ ❿  - ☉ 🌕 ☽ ☾ ⸿ ✝ 🕇 🕜 🕝 🕞 🕟 🕠 🕡 🕢 🕣 🕤 🕥 🕦 🕧 🙨 🙩 • ● ⚫ ⬤ 🞅 🞆 🞇 🞈 🞊 ⦿ ◾ - ■ ◼ ⬛ ⬜ 🞑 🞒 🞓 🞔 ▣ 🞕 🞖 🞗 ⬩ ⬥ ◆ ◇ 🞚 ◈ 🞛 🞜 🞝 ⬪ ⬧ ⧫ ◊ 🞠 ◖ ◗ ⯊ ⯋ ◼ ⬥ - ⬟ ⯂ ⬣ ⬢ ⯃ ⯄ 🞡 🞢 🞣 🞤 🞥 🞦 🞧 🞨 🞩 🞪 🞫 🞬 🞭 🞮 🞯 🞰 🞱 🞲 🞳 🞴 🞵 🞶 🞷 🞸 🞹 🞺 - 🞻 🞼 🞽 🞾 🞿 🟀 🟂 🟄 ✦ 🟉 ★ ✶ 🟋 ✷ 🟏 🟒 ✹ 🟃 🟇 ✯ 🟍 🟔 ⯌ ⯍ ※ ⁂ -]); - -1; diff --git a/Encode/Wingdings3.pm b/Encode/Wingdings3.pm deleted file mode 100644 index 85ce8d1..0000000 --- a/Encode/Wingdings3.pm +++ /dev/null @@ -1,22 +0,0 @@ -package Encode::Webdings3; - -use 5.014; -use warnings; -use utf8; - -our $VERSION = '1.00'; - -use parent 'Encode::Wingdings'; -__PACKAGE__->Define('wingdings3'); - -our @MAP = (qw[ - ⭠ ⭢ ⭡ ⭣ ⭦ ⭧ ⭩ ⭨ ⭰ ⭲ ⭱ ⭳ ⭶ ⭸ ⭻ ⭽ ⭤ ⭥ ⭪ ⭬ ⭫ ⭭ ⭍ ⮠ ⮡ ⮢ ⮣ ⮤ ⮥ ⮦ ⮧ - ⮐ ⮑ ⮒ ⮓ ⮀ ⮃ ⭾ ⭿ ⮄ ⮆ ⮅ ⮇ ⮏ ⮍ ⮎ ⮌ ⭮ ⭯ ⎋ ⌤ ⌃ ⌥ ⎵ ⏡ ⇪ ⮸ 🢠 🢡 🢢 🢣 🢤 🢥 - 🢦 🢧 🢨 🢩 🢪 🢫 ← → ↑ ↓ ↖ ↗ ↙ ↘ 🡘 🡙 ▲ ▼ △ ▽ ◄ ► ◁ ▷ ◣ ◢ ◤ ◥ 🞀 🞂 🞁  - 🞃 ▲ ▼ ◀ ▶ ⮜ ⮞ ⮝ ⮟ 🠐 🠒 🠑 🠓 🠔 🠖 🠕 🠗 🠘 🠚 🠙 🠛 🠜 🠞 🠝 🠟 🠀 🠂 🠁 🠃 🠄 🠆 🠅 - 🠇 🠈 🠊 🠉 🠋 🠠 🠢 🠤 🠦 🠨 🠨 🠪 🢜 🢝 🢞 🢟 🠮 🠰 🠲 🠴 🠶 🠸 🠺 🠹 🠻 🢘 🢚 🢙 🢛 🠼 🠾 🠽 - 🠿 🡀 🡂 🡁 🡃 🡄 🡆 🡅 🡇 ⮨ ⮩ ⮪ ⮫ ⮬ ⮭ ⮮ ⮯ 🡠 🡢 🡡 🡣 🡤 🡥 🡧 🡦 🡰 🡲 🡱 🡳 🡴 🡵 🡷 - 🡶 🢀 🢂 🢁 🢃 🢄 🢅 🢇 🢆 🢐 🢒 🢑 🢓 🢔 🢖 🢕 🢗 -]); - -1; diff --git a/charset-encoding.inc.pl b/charset-encoding.inc.pl index 6e46477..92330ab 100644 --- a/charset-encoding.inc.pl +++ b/charset-encoding.inc.pl @@ -71,10 +71,50 @@ use utf8; }, }, 'adobesymbol' => {inherit => ['symbol' => '20-7F+A0', '' => '20-7F+A0']}, # minor differences, irrelevant except for different '€' - 'wingdings' => {inherit => ['' => '20'], setup => sub {require Encode::Wingdings}}, - 'wingdings2' => {inherit => ['' => '20'], setup => sub {require Encode::Wingdings2}}, - 'wingdings3' => {inherit => ['' => '20'], setup => sub {require Encode::Wingdings3}}, - 'webdings' => {inherit => ['' => '20'], setup => sub {require Encode::Webdings}}, + 'wingdings' => {inherit => ['' => '20'], setup => sub { + $_[0]->{table} = [(map {chr} 0 .. 0x20), qw( + 🖉 ✂ ✁ 👓 🕭 🕮 🕯 🕿 ✆ 🖂 🖃 📪 📫 📬 📭 📁 📂 📄 🗏 🗐 🗄 ⌛ 🖮 🖰 🖲 🖳 🖴 🖫 🖬 ✇ ✍ + 🖎 ✌ 👌 👍 👎 ☜ ☞ ☝ ☟ 🖐 ☺ 😐 ☹ 💣 ☠ 🏳 🏱 ✈ ☼ 💧 ❄ 🕆 ✞ 🕈 ✠ ✡ ☪ ☯ ॐ ☸ ♈ ♉ + ♊ ♋ ♌ ♍ ♎ ♏ ♐ ♑ ♒ ♓ 🙰 🙵 ● 🔾 ■ □ 🞐 ❑ ❒ ⬧ ⧫ ◆ ❖ ⬥ ⌧ ⮹ ⌘ 🏵 🏶 🙶 🙷  + ⓪ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⓿ ❶ ❷ ❸ ❹ ❺ ❻ ❼ ❽ ❾ ❿ 🙢 🙠 🙡 🙣 🙞 🙜 🙝 🙟 · • + ▪ ⚪ 🞆 🞈 ◉ ◎ 🔿 ▪ ◻ 🟂 ✦ ★ ✶ ✴ ✹ ✵ ⯐ ⌖ ⟡ ⌑ ⯑ ✪ ✰ 🕐 🕑 🕒 🕓 🕔 🕕 🕖 🕗 🕘 + 🕙 🕚 🕛 ⮰ ⮱ ⮲ ⮳ ⮴ ⮵ ⮶ ⮷ 🙪 🙫 🙕 🙔 🙗 🙖 🙐 🙑 🙒 🙓 ⌫ ⌦ ⮘ ⮚ ⮙ ⮛ ⮈ ⮊ ⮉ ⮋ 🡨 + 🡪 🡩 🡫 🡬 🡭 🡯 🡮 🡸 🡺 🡹 🡻 🡼 🡽 🡿 🡾 ⇦ ⇨ ⇧ ⇩ ⬄ ⇳ ⬀ ⬁ ⬃ ⬂ 🢬 🢭 🗶 ✔ 🗷 🗹  + )]; + }}, + 'wingdings2' => {inherit => ['' => '20'], setup => sub { + $_[0]->{table} = [(map {chr} 0 .. 0x20), qw( + 🖊 🖋 🖌 🖍 ✄ ✀ 🕾 🕽 🗅 🗆 🗇 🗈 🗉 🗊 🗋 🗌 🗍 📋 🗑 🗔 🖵 🖶 🖷 🖸 🖭 🖯 🖱 🖒 🖓 🖘 🖙 + 🖚 🖛 👈 👉 🖜 🖝 🖞 🖟 🖠 🖡 👆 👇 🖢 🖣 🖑 🗴 ✓ 🗵 ☑ ☒ ☒ ⮾ ⮿ ⦸ ⦸ 🙱 🙴 🙲 🙳 ‽ 🙹 🙺 + 🙻 🙦 🙤 🙥 🙧 🙚 🙘 🙙 🙛 ⓪ ① ② ③ ④ ⑤ ⑥ ⑦ ⑧ ⑨ ⑩ ⓿ ❶ ❷ ❸ ❹ ❺ ❻ ❼ ❽ ❾ ❿  + ☉ 🌕 ☽ ☾ ⸿ ✝ 🕇 🕜 🕝 🕞 🕟 🕠 🕡 🕢 🕣 🕤 🕥 🕦 🕧 🙨 🙩 • ● ⚫ ⬤ 🞅 🞆 🞇 🞈 🞊 ⦿ ◾ + ■ ◼ ⬛ ⬜ 🞑 🞒 🞓 🞔 ▣ 🞕 🞖 🞗 ⬩ ⬥ ◆ ◇ 🞚 ◈ 🞛 🞜 🞝 ⬪ ⬧ ⧫ ◊ 🞠 ◖ ◗ ⯊ ⯋ ◼ ⬥ + ⬟ ⯂ ⬣ ⬢ ⯃ ⯄ 🞡 🞢 🞣 🞤 🞥 🞦 🞧 🞨 🞩 🞪 🞫 🞬 🞭 🞮 🞯 🞰 🞱 🞲 🞳 🞴 🞵 🞶 🞷 🞸 🞹 🞺 + 🞻 🞼 🞽 🞾 🞿 🟀 🟂 🟄 ✦ 🟉 ★ ✶ 🟋 ✷ 🟏 🟒 ✹ 🟃 🟇 ✯ 🟍 🟔 ⯌ ⯍ ※ ⁂ + )]; + }}, + 'wingdings3' => {inherit => ['' => '20'], setup => sub { + $_[0]->{table} = [(map {chr} 0 .. 0x20), qw( + ⭠ ⭢ ⭡ ⭣ ⭦ ⭧ ⭩ ⭨ ⭰ ⭲ ⭱ ⭳ ⭶ ⭸ ⭻ ⭽ ⭤ ⭥ ⭪ ⭬ ⭫ ⭭ ⭍ ⮠ ⮡ ⮢ ⮣ ⮤ ⮥ ⮦ ⮧ + ⮐ ⮑ ⮒ ⮓ ⮀ ⮃ ⭾ ⭿ ⮄ ⮆ ⮅ ⮇ ⮏ ⮍ ⮎ ⮌ ⭮ ⭯ ⎋ ⌤ ⌃ ⌥ ⎵ ⏡ ⇪ ⮸ 🢠 🢡 🢢 🢣 🢤 🢥 + 🢦 🢧 🢨 🢩 🢪 🢫 ← → ↑ ↓ ↖ ↗ ↙ ↘ 🡘 🡙 ▲ ▼ △ ▽ ◄ ► ◁ ▷ ◣ ◢ ◤ ◥ 🞀 🞂 🞁  + 🞃 ▲ ▼ ◀ ▶ ⮜ ⮞ ⮝ ⮟ 🠐 🠒 🠑 🠓 🠔 🠖 🠕 🠗 🠘 🠚 🠙 🠛 🠜 🠞 🠝 🠟 🠀 🠂 🠁 🠃 🠄 🠆 🠅 + 🠇 🠈 🠊 🠉 🠋 🠠 🠢 🠤 🠦 🠨 🠨 🠪 🢜 🢝 🢞 🢟 🠮 🠰 🠲 🠴 🠶 🠸 🠺 🠹 🠻 🢘 🢚 🢙 🢛 🠼 🠾 🠽 + 🠿 🡀 🡂 🡁 🡃 🡄 🡆 🡅 🡇 ⮨ ⮩ ⮪ ⮫ ⮬ ⮭ ⮮ ⮯ 🡠 🡢 🡡 🡣 🡤 🡥 🡧 🡦 🡰 🡲 🡱 🡳 🡴 🡵 🡷 + 🡶 🢀 🢂 🢁 🢃 🢄 🢅 🢇 🢆 🢐 🢒 🢑 🢓 🢔 🢖 🢕 🢗 + )]; + }}, + 'webdings' => {inherit => ['' => '20'], setup => sub { + $_[0]->{table} = [(map {chr} 0 .. 0x20), qw( + 🕷 🕸 🕲 🕶 🏆 🎖 🖇 🗨 🗩 🗰 🗱 🌶 🎗 ▞ 🙼 🗕 🗖 🗗 ⏴ ⏵ ⏶ ⏷ ⏪ ⏩ ⏮ ⏭ ⏸ ⏹ ⏺ 🗚 🗳 + 🛠 🏗 🏘 🏙 🏚 🏜 🏭 🏛 🏠 🏖 🏝 🛣 🔍 🏔 👁 👂 🏞 🏕 🛤 🏟 🛳 🕬 🕫 🕨 🔈 🎔 🎕 🗬 🙽 🗭 🗪 🗫 + ⮔ ✔ 🚲 □ 🛡 📦 🛱 ■ 🚑 🛈 🛩 🛰 🟈 🕴 ⚫ 🛥 🚔 🗘 🗙 ❓ 🛲 🚇 🚍 ⛳ 🛇 ⊖ 🚭 🗮 | 🗯 🗲  + 🚹 🚺 🛉 🛊 🚼 👽 🏋 ⛷ 🏂 🏌 🏊 🏄 🏍 🏎 🚘 🗠 🛢 💰 🏷 💳 👪 🗡 🗢 🗣 ✯ 🖄 🖅 🖃 🖆 🖹 🖺 🖻 + 🕵 🕰 🖽 🖾 📋 🗒 🗓 📖 📚 🗞 🗟 🗃 🗂 🖼 🎭 🎜 🎘 🎙 🎧 💿 🎞 📷 🎟 🎬 📽 📹 📾 📻 🎚 🎛 📺 💻 + 🖥 🖦 🖧 🕹 🎮 🕻 🕼 📟 🖁 🖀 🖨 🖩 🖿 🖪 🗜 🔒 🔓 🗝 📥 📤 🕳 🌣 🌤 🌥 🌦 ☁ 🌧 🌨 🌩 🌪 🌬 🌫 + 🌜 🌡 🛋 🛏 🍽 🍸 🛎 🛍 Ⓟ ♿ 🛆 🖈 🎓 🗤 🗥 🗦 🗧 🛪 🐿 🐦 🐟 🐕 🐈 🙬 🙮 🙭 🙯 🗺 🌍 🌏 🌎 🕊 + )]; + }}, 'iso-8859-2' => {inherit => ['iso-8859-1' => 'A0']}, 'iso-8859-3' => {inherit => ['iso-8859-1' => 'A0']}, #TODO: also apply to iso-8859-9 diff --git a/charset.plp b/charset.plp index 6ec4a24..8e67c67 100644 --- a/charset.plp +++ b/charset.plp @@ -149,7 +149,9 @@ sub tabinput { } $row{endpoint} ||= 0xFF; - if ($row{set}) {} + if (defined $row{table} or defined $row{cell}) { + $row{set} //= $input; + } elsif ($row{set} = Encode::resolve_alias($input)) { $row{offset} = delete $row{startpoint}; if ($charset->{varchar}) { @@ -165,9 +167,7 @@ sub tabinput { } $row{endpoint} -= $row{offset}; - - $visible->{ascii} = # assume common base - $visible->{ $row{set} } = 1; + $visible->{ascii}++; # assume common base } else { Alert("Encoding $input unknown"); @@ -206,6 +206,7 @@ sub tabinput { } push @request, \%row; + $visible->{ $row{set} } = 1 if $row{table}; } tabinput($_) for @tablist; @@ -329,7 +330,7 @@ for my $row (@request) { my $cp = $offset + $row->{offset}; my $glyph = ref $row->{table} eq 'ARRAY' ? $row->{table}->[$offset] : substr $row->{table}, $offset, 1; - my ($cell, $name, $class) = $glyph eq $NOCHAR ? () : + my ($cell, $name, $class) = !defined $glyph || $glyph eq $NOCHAR ? () : $glyphs->glyph_html($glyph); if ($mode) {