X-Git-Url: http://git.shiar.nl/sheet.git/blobdiff_plain/6bf3cfbf5a62745381ebb3f6c5ee72eabd8366f5..b16ebb61e918ea6b67674f515814f4fae6fcc37f:/charset.plp diff --git a/charset.plp b/charset.plp index e82e3d7..9dd98a4 100644 --- a/charset.plp +++ b/charset.plp @@ -43,7 +43,7 @@ sub optionlink { print join " •\n", ( map { join " ·\n", pairmap { - optionlink($b || ucfirst $a, "/charset/$a?compare", $a eq $Request); + optionlink($b || ucfirst $a, '/charset'.($a && "/$a?compare"), $a eq $Request); } @{$_} } [ @@ -51,6 +51,7 @@ print join " •\n", ( dos => 'DOS', mac => 'Apple', ebcdic => 'EBCDIC', + $tablist[0] eq 'default' ? () : ('' => 'common'), ], [ westeur => 'West', @@ -297,14 +298,21 @@ sub tabinput { } $row{endpoint} -= $row{offset}; - 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 - 25D8 25CB 25D9 2642 2640 266A 266B 263C - 25BA 25C4 2195 203C 00B6 00A7 25AC 21A8 - 2191 2193 2192 2190 221F 2194 25B2 25BC - ); + if ($row{set} eq 'cp437') { + for my $phipos (237 - $row{offset}) { + next if $phipos < 0 or $phipos > $row{endpoint}; + # replace phi glyph + substr($row{table}, $phipos, 1) = pack 'U*', 0x3D5; + } + if ($row{offset} == 0) { + # replace control characters by visible variants + substr($row{table}, 0, 32) = pack 'U*', map {hex} qw( + 2007 263A 263B 2665 2666 2663 2660 2022 + 25D8 25CB 25D9 2642 2640 266A 266B 263C + 25BA 25C4 2195 203C 00B6 00A7 25AC 21A8 + 2191 2193 2192 2190 221F 2194 25B2 25BC + ); + } } $visible->{ascii} = # assume common base