charset: replace private use glyphs in MacHebrew
[sheet.git] / charset.plp
index 7f19bc183e6fb02abd1d91622041cf7f75479905..6300622f3ea16088b40c6aee93c63a96f93ec1b2 100644 (file)
@@ -147,11 +147,11 @@ sub tabinput {
                eval { $charset->{setup}->(\%row) }
                        or Alert("Incomplete setup of $input", $@);
        }
+       $row{endpoint} ||= 0xFF;
 
        if ($row{set}) {}
        elsif ($row{set} = Encode::resolve_alias($input)) {
                $row{offset} = delete $row{startpoint};
-               $row{endpoint} ||= 0xFF;
                if ($row{set} eq 'MacHebrew' or $row{set} eq 'MacThai') {
                        # array of possibly multiple characters per code point
                        $row{table} = [
@@ -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) {