X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/a8a1b6ccabca261ce3335b1f233cf0146bd0fab1..c5edeb4e1b7c302cc5840cc83d7474b8f1384ab6:/charset.plp diff --git a/charset.plp b/charset.plp index 7794284..486fece 100644 --- a/charset.plp +++ b/charset.plp @@ -24,6 +24,7 @@ my @tablist = split /[^\w-]+/, $Request || 'default'; use POSIX qw( ceil ); use Shiar_Sheet::FormatChar; my $glyphs = Shiar_Sheet::FormatChar->new; +my @request; sub tabinput { # generate character table(s) @@ -59,7 +60,8 @@ sub tabinput { 11 => 'thai', }; if (my $follow = $ALIAS->{$input}) { - return map { tabinput($_) } ref $follow ? @{$follow} : $follow; + tabinput($_) for ref $follow ? @{$follow} : $follow; + return; } my %row = (offset => 0, cols => 16); @@ -107,7 +109,7 @@ sub tabinput { # (~16x faster than decoding in loop; # substr strings is twice as fast as splitting to an array) - if ($row{set} eq 'cp437') { + if ($row{set} eq 'cp437' and !$row{offset}) { substr($row{table}, 237, 1) = pack 'U*', 0x3D5; # phi sign substr($row{table}, 0, 32) = pack 'U*', map {hex} qw( 2007 263A 263B 2665 2666 2663 2660 2022 @@ -122,9 +124,9 @@ sub tabinput { Alert("Encoding $input unknown"); return; } - return \%row; + push @request, \%row; } -my @request = map { tabinput($_) } @tablist; +tabinput($_) for @tablist; my $NOCHAR = chr 0xFFFD;