X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/2f6bd0f228e04949e561c9e5d7713a0baef77cd5..cc77ead3a819db005fce5de21c36aaa000885a30:/charset-encoding.inc.pl diff --git a/charset-encoding.inc.pl b/charset-encoding.inc.pl index 0f1d2d6..c402187 100644 --- a/charset-encoding.inc.pl +++ b/charset-encoding.inc.pl @@ -1,8 +1,9 @@ use 5.014; use warnings; +use utf8; +{ - default => [qw( u+0-27F utf-8+realsize iso-8859-1 iso-8859-15 cp1252 cp437 cp850 )], + default => [qw( u+0-27F utf8+realsize iso-8859-1 iso-8859-15 cp1252 cp437 cp850 )], unicode => [qw( uu+cols=32+realsize u+0-FFF u+1000-18AF u+18B0-1FFF )], us => [qw( cp437 cp863 gsm0338 AdobeStandardEncoding )], ebcdic => [qw( cp37 cp500 cp1047 posix-bc cp1026 cp875 )], @@ -45,12 +46,30 @@ use warnings; 11 => 'thai', 'ascii' => {inherit => ['' => '00-7F']}, - 'cp437' => {inherit => ['cp850' => 0, 'ascii' => '00-1F+80']}, # ascii range overridden later + 'cp437' => { + inherit => ['cp850' => 0, 'ascii' => '00-1F+80'], # ascii range overridden later + replace => { + 0 => ' ☺☻♥♦♣♠•◘○◙♂♀♪♫☼►◄↕‼¶§▬↨↑↓→←∟↔▲▼', # visible variants of control characters + 0xED => 'ϕ', # non-greek usage and appearance + }, + }, 'gsm0338' => {inherit => ['ascii' => '00-7F']}, 'dingbats' => {inherit => ['' => '20-7F+A0']}, 'macdingbats' => {inherit => ['dingbats' => '80-9F']}, 'adobezdingbat'=> {inherit => ['MacDingbats' => '80-9F']}, # should be identical but maps to private use - 'symbol' => {inherit => ['' => '20-7F+A0']}, + 'symbol' => { + inherit => ['' => '20-7F+A0'], + replace => { + 0x60 => '│', # replace radical extender by closest unicode equivalent + 0xBD => '⏐⎯', # arrow extenders + 0xD2 => '®©™', # serif variants + 0xE0 => '◊', # replace lookalike, should match AdobeSymbol + 0xE2 => '®©™', # sans-serif variants + 0xE6 => '⎛⎜⎝⎡⎢⎣⎧⎨⎩⎪', + 0xF0 => '€', + 0xF4 => '⎮⌡⎞⎟⎠⎤⎥⎦⎫⎬⎭', + }, + }, '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}}, @@ -112,7 +131,15 @@ use warnings; 'macsami' => {inherit => ['MacIcelandic' => '90-BF+D0-DF+F0', 'MacRoman' => '90']}, 'macgreek' => {inherit => ['MacRoman' => '80']}, 'maccyrillic' => {inherit => ['MacRoman' => '80']}, - 'machebrew' => {inherit => ['iso-8859-8' => '80', 'MacRoman' => '80-8F+A0']}, # partial ascii + 'machebrew' => { + inherit => ['iso-8859-8' => '80', 'MacRoman' => '80-8F+A0'], # ignore partial ascii + replace => { + # strip private use characters for unneeded roundtrip + 0xDE => chr(0x5C7), # qamats qatan + 0xC0 => 'לֹ', # lamed holam + #TODO: private use for canoral codes (obsolete nikud positioning) + }, + }, 'macarabic' => {inherit => ['iso-8859-6' => '80', 'cp864' => '80', 'MacRoman' => '80']}, #TODO: multiple parents 'macfarsi' => {inherit => ['MacArabic' => 'B0-BF', 'MacRoman' => '80']}, @@ -164,13 +191,12 @@ use warnings; $row->{set} = 'Unicode planes'; return $row; }}, - 'utf-8' => 'utf8', utf8 => {setup => sub { my $row = shift; $row->{set} = 'UTF-8'; $row->{cell} = do 'charset-utf8.inc.pl' or Alert('Table data could not be read', $@ || $!); - $row->{endpoint} = 0xFF; return $row; }}, + 'utf-8' => 'utf8', };