charset: replace private use glyphs in MacHebrew
authorMischa POSLAWSKY <perl@shiar.org>
Sat, 22 Apr 2017 12:36:03 +0000 (14:36 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Thu, 25 May 2017 20:13:03 +0000 (22:13 +0200)
charset-encoding.inc.pl
charset.plp

index c1fd74c8936ca6d33159c69ee6fb9eff4b51452c..c402187a201d99acca878351470c15542a8767bd 100644 (file)
@@ -131,7 +131,15 @@ use utf8;
        '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']},
 
index 5b415eec8387bb6cf6b76e81f7ae3c52d9093f5e..6300622f3ea16088b40c6aee93c63a96f93ec1b2 100644 (file)
@@ -178,6 +178,12 @@ sub tabinput {
                while (my ($offset, $sub) = each %{$replace}) {
                        $offset -= $row{offset};
 
+                       if (ref $row{table} eq 'ARRAY') {
+                               $row{table}->[$offset] = $sub
+                                       if $offset >= 0 and $offset <= $row{endpoint};
+                               next;
+                       }
+
                        my $length = length $sub;
 
                        if ($offset < 0) {