X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/118ce9cbe12833adf7cb911d41a3139ab1f9cd7c..a93c5c61b18192c5f74256e3cb18e7f1cd2034d5:/charset.plp?ds=inline
diff --git a/charset.plp b/charset.plp
index d8527f0..9ab15f1 100644
--- a/charset.plp
+++ b/charset.plp
@@ -55,6 +55,7 @@ print join " â¢\n", (
dos => 'DOS',
mac => 'Apple',
ebcdic => 'EBCDIC',
+ legacy => 'legacy',
$tablist[0] eq 'default' ? () : ('' => 'common'),
],
[
@@ -97,6 +98,7 @@ sub tabinput {
state $visible = {'' => 1}; # all present tables
my %row = (offset => 0, cols => 16);
+ $row{$_} = $charset->{$_} for qw( note ); # copy metadata
if (not defined $params) {
my @parents = @{ $charset->{inherit} || [] };
@@ -131,7 +133,7 @@ sub tabinput {
# extend earlier range
my $skip = int(($row{endpoint} || $row{startpoint}) / $row{cols});
for ($skip + 1 .. (hex($+{start}) / $row{cols}) - 1) {
- $row{skip}->{ $_ * $row{cols} - $row{startpoint} }++;
+ $row{skip}->{ $_ * $row{cols} }++;
}
}
else {
@@ -153,7 +155,7 @@ sub tabinput {
if (defined $row{table} or defined $row{cell}) {
$row{set} //= $input;
}
- elsif ($row{set} = Encode::resolve_alias($input)) {
+ elsif ($row{set} = Encode::resolve_alias($charset->{set} // $input)) {
$row{offset} = delete $row{startpoint};
if ($charset->{varchar}) {
# array of possibly multiple characters per code point
@@ -169,6 +171,7 @@ sub tabinput {
$row{endpoint} -= $row{offset};
$visible->{ascii}++; # assume common base
+ $row{set} = $input if $charset->{set}; # base override
}
else {
Alert("Encoding $input
unknown");
@@ -289,8 +292,8 @@ for my $row (@request) {
printf '
'; - if (defined $row->{skip}->{$offset}) { + if (defined $row->{skip}->{$offset + $row->{offset}}) { print 'â®'; } else { @@ -340,14 +343,14 @@ for my $row (@request) { $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}++; } - print ' | %s', $class, $cell) : '>'; } continue { |
---|