charset: compare unknown glyphs in custom tables
authorMischa POSLAWSKY <perl@shiar.org>
Wed, 29 Dec 2021 18:35:36 +0000 (19:35 +0100)
committerMischa POSLAWSKY <perl@shiar.org>
Mon, 7 Feb 2022 17:42:33 +0000 (18:42 +0100)
Ignore missing classes in Perl v5.28 for Unicode v13.0 legacy computing
symbols, while keeping unassigned code points in unicode blocks (various
gaps in Greek overview).

charset-encoding.inc.pl
charset.plp

index 2da7614623044f5f0e878acacc7ede49f9661306..b5345101f966b750c167a8690f9fa5d5f85d481f 100644 (file)
@@ -271,7 +271,8 @@ use utf8;
                $row->{endpoint} ||= ($block + 1 << 8) - 1;
                $block == ($row->{endpoint} >> 8) or undef $block;
 
                $row->{endpoint} ||= ($block + 1 << 8) - 1;
                $block == ($row->{endpoint} >> 8) or undef $block;
 
-               $row->{table} = join '', map { chr } $row->{offset} .. $row->{endpoint};
+               $row->{table} = join '', map { chr =~ s/\A\p{Unassigned}\z/�/r }
+                       $row->{offset} .. $row->{endpoint};
                utf8::upgrade($row->{table});  # prevent latin1 output
 
                $row->{endpoint} -= $row->{offset};
                utf8::upgrade($row->{table});  # prevent latin1 output
 
                $row->{endpoint} -= $row->{offset};
index 49f2d504e12dbfe145f44b7246fb0f99919c337d..2257fb8bbaf2987d6055f69a1c8ed12e82e9b915 100644 (file)
@@ -342,7 +342,7 @@ for my $row (@request) {
                                        $cp == ord $glyph ? 'l4' :
                                        $row->{parent} && $glyph eq
                                                Encode::decode($row->{parent}, pack 'C', $cp) ? 'l3' :
                                        $cp == ord $glyph ? 'l4' :
                                        $row->{parent} && $glyph eq
                                                Encode::decode($row->{parent}, pack 'C', $cp) ? 'l3' :
-                                       !$class ? undef :
+                                       !defined $cell ? undef :
                                        $visible->{$glyph} ? 'l2' :
                                        'l1'
                                );
                                        $visible->{$glyph} ? 'l2' :
                                        'l1'
                                );