sc: lotv patch v5.0.13 (2024-03-26)
[sheet.git] / charset.plp
index 9ab15f1a20764ac55bc1994a01abcf6a1249d266..c9cb5f7bdf3f00821f936be9ee0a9e4b65672f19 100644 (file)
@@ -5,7 +5,8 @@ my @tablist = split m{/+}, $Request || 'default';
 
 Html({
        title => 'charset cheat sheet',
-       version => '1.2',
+       version => '1.4',
+       canonical => "/charset/$Request" . ($mode && '?compare'),
        description => [
                "Reference sheet with all glyphs in common character encoding tables,",
                "and an overview of Unicode ranges and UTF-8 bytes.",
@@ -14,9 +15,8 @@ Html({
                charset codepage unicode ascii utf8 latin glyph character encoding
                reference common overview table
        '],
-       (stylesheet => [qw'light']) x !$mode,
        data => [qw(
-               charset-encoding.inc.pl
+               charset.inc.pl charset-encoding.inc.pl
                charset-unicode.inc.pl charset-ucplanes.inc.pl charset-utf8.inc.pl
        )],
 });
@@ -56,6 +56,7 @@ print join " •\n", (
                mac      => 'Apple',
                ebcdic   => 'EBCDIC',
                legacy   => 'legacy',
+               symbols  => 'symbols',
                $tablist[0] eq 'default' ? () : ('' => 'common'),
        ],
        [
@@ -79,8 +80,7 @@ use Shiar_Sheet::FormatChar;
 my $glyphs = Shiar_Sheet::FormatChar->new;
 my @request;
 
-my $charsets = do 'charset-encoding.inc.pl'
-       or Alert('Encoding metadata could not be read', $@ || $!);
+my $charsets = Data('charset');
 
 sub tabinput {
        # generate character table(s)
@@ -98,7 +98,7 @@ sub tabinput {
 
        state $visible = {'' => 1};  # all present tables
        my %row = (offset => 0, cols => 16);
-       $row{$_} = $charset->{$_} for qw( note );  # copy metadata
+       $row{$_} = $charset->{$_} for qw( note table );  # copy metadata
 
        if (not defined $params) {
                my @parents = @{ $charset->{inherit} || [] };
@@ -116,7 +116,7 @@ sub tabinput {
                }
                elsif (@parents) {
                        $row{parent} = $parents[0];
-                       $params = $parents[1] if hex $parents[1] == 0;  # apply ascii end
+                       $params = $parents[1] if $parents[1] =~ /^0+-/;  # apply ascii end
                }
                $visible->{$_} //= 0 for $row{parent} || ();
        }