X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/a180fb63ca5b34948194aad96395f3ba8ec5b22d..fc86468387a30434587a1ec138256813bf5cf7b1:/charset.plp diff --git a/charset.plp b/charset.plp index b6b61b9..5955c39 100644 --- a/charset.plp +++ b/charset.plp @@ -48,6 +48,7 @@ print join " •\n", ( } [ iso => 'ISO', + win => 'Windows', dos => 'DOS', mac => 'Apple', ebcdic => 'EBCDIC', @@ -78,7 +79,7 @@ sub tabinput { state $ALIAS = { default => [qw( u+0-639 utf-8+realsize iso-8859-1 iso-8859-15 cp1252 cp437 cp850 )], - unicode => [qw( uu+cols=32 u+0-4095 u+4096-6319 u+6320-8191 )], + unicode => [qw( uu+cols=32+realsize u+0-4095 u+4096-6319 u+6320-8191 )], us => [qw( cp437 cp863 gsm0338 AdobeStandardEncoding )], ebcdic => [qw( cp37 cp500 cp1047 posix-bc cp1026 cp875 )], iso => [map {"iso-8859-$_"} 1 .. 11, 13 .. 16], @@ -345,15 +346,16 @@ sub range_cell { if ($len -= $rest) { # continued on new row my @next = ($len * $colsize, "$class joinu"); + my $separate = $cols - $len > $rest; # columns not on next row if ($len > $rest) { # minority remains push @next, $name, $title; $title ||= $name; - $name = ''; + $name = $separate && '…'; } else { # minority on next row - push @next, '"', $title || $name; + push @next, $separate && '"', $title || $name; } $table->{$offset + $colsize*$rest} //= \@next; $class .= ' joind'; @@ -439,28 +441,27 @@ for my $row (@request) { next; } + my $cp = $offset + $row->{offset}; my $glyph = ref $row->{table} eq 'ARRAY' ? $row->{table}->[$offset] : substr $row->{table}, $offset, 1; - if ($glyph eq $NOCHAR) { - print ''; - next; - } + my ($cell, $name, $class) = $glyph eq $NOCHAR ? () : + $glyphs->glyph_html($glyph); if (exists $get{compare}) { state $visible = {}; - my $cp = $offset + $row->{offset}; - printf '%2$s', + $class = ( $cp == ord $glyph ? 'l4' : $row->{parent} && $glyph eq Encode::decode($row->{parent}, pack 'C', $cp) ? 'l3' : + !$class ? undef : $visible->{$glyph} ? 'l2' : - 'l1', - $glyphs->glyph_html($glyph); + 'l1' + ); $visible->{$glyph}++; - next; } - say $glyphs->glyph_cell($glyph); + say sprintf $class ? '%s' : '', + $name, $class, $cell; } continue { $offset += $colsize;