charset: ucd fallback for undigraphed characters
[sheet.git] / charset.plp
index a3e845da8f9c6afa6fec4e8dde7ba572d2de0fed..f9a773a3a240d00a970d4e7f0ef272e96d806e65 100644 (file)
@@ -115,7 +115,7 @@ my @nibble = (0..9, 'A'..'F');
 for my $row (@request) {
        printf '<li><table class="glyphs%s">', !$row->{cell} && ' charmap';
        printf '<caption>%s</caption>', $row->{set};
-       print '<col>';
+       print '<col>' x 17;
        for my $section (qw{thead}) {
                print "<$section><tr><th>↱";
                print '<th>', $_ for @nibble;
@@ -140,6 +140,11 @@ for my $row (@request) {
                        if (defined (my $mnem = $di{ord $glyph})) {
                                $info = $diinfo->{$mnem};
                        }
+                       else {
+                               require Unicode::UCD;
+                               my $fullinfo = Unicode::UCD::charinfo(ord $glyph);
+                               $info = [@$fullinfo{qw/code name category script string/}] if $fullinfo;
+                       }
                        my ($codepoint, $name, $prop, $script, $string) = @$info;
 
                        $glyph = quote($string || $glyph);