git.shiar.nl
/
sheet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
charset: legacy encodings petscii, atascii, msx, zx-spectrum
[sheet.git]
/
charset.plp
diff --git
a/charset.plp
b/charset.plp
index 4272b6a4110b2ea309fb0fcecf5df65975f009b7..ccbf145cf6ce28e674fa2e440209321309011089 100644
(file)
--- a/
charset.plp
+++ b/
charset.plp
@@
-5,7
+5,7
@@
my @tablist = split m{/+}, $Request || 'default';
Html({
title => 'charset cheat sheet',
Html({
title => 'charset cheat sheet',
- version => '1.
1
',
+ version => '1.
2
',
description => [
"Reference sheet with all glyphs in common character encoding tables,",
"and an overview of Unicode ranges and UTF-8 bytes.",
description => [
"Reference sheet with all glyphs in common character encoding tables,",
"and an overview of Unicode ranges and UTF-8 bytes.",
@@
-14,7
+14,7
@@
Html({
charset codepage unicode ascii utf8 latin glyph character encoding
reference common overview table
'],
charset codepage unicode ascii utf8 latin glyph character encoding
reference common overview table
'],
-
stylesheet => [qw'light']
,
+
(stylesheet => [qw'light']) x !$mode
,
data => [qw(
charset-encoding.inc.pl
charset-unicode.inc.pl charset-ucplanes.inc.pl charset-utf8.inc.pl
data => [qw(
charset-encoding.inc.pl
charset-unicode.inc.pl charset-ucplanes.inc.pl charset-utf8.inc.pl
@@
-28,8
+28,15
@@
use List::Util qw( first pairmap pairfirst pairs );
<p>
<:
<p>
<:
+if ($tablist[0] eq 'unicode') {
+ say "Detailed allocation of Unicode blocks.";
+ print "See ", showlink("charsets", '/charset'), " to compare specific encodings";
+}
+else {
+
if ($tablist[0] eq 'default') {
if ($tablist[0] eq 'default') {
- say "Overview of Unicode allocation and common latin code pages.";
+ say "Overview of Unicode ", showlink("allocation", '/charset/unicode');
+ say "and common latin code pages.";
say "Compare alternate charsets:";
}
else {
say "Compare alternate charsets:";
}
else {
@@
-48,6
+55,7
@@
print join " •\n", (
dos => 'DOS',
mac => 'Apple',
ebcdic => 'EBCDIC',
dos => 'DOS',
mac => 'Apple',
ebcdic => 'EBCDIC',
+ legacy => 'legacy',
$tablist[0] eq 'default' ? () : ('' => 'common'),
],
[
$tablist[0] eq 'default' ? () : ('' => 'common'),
],
[
@@
-60,6
+68,8
@@
print join " •\n", (
hebrew => 0,
],
);
hebrew => 0,
],
);
+
+}
:>.
</p>
:>.
</p>
@@
-144,7
+154,7
@@
sub tabinput {
if (defined $row{table} or defined $row{cell}) {
$row{set} //= $input;
}
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
$row{offset} = delete $row{startpoint};
if ($charset->{varchar}) {
# array of possibly multiple characters per code point
@@
-160,6
+170,7
@@
sub tabinput {
$row{endpoint} -= $row{offset};
$visible->{ascii}++; # assume common base
$row{endpoint} -= $row{offset};
$visible->{ascii}++; # assume common base
+ $row{set} = $input if $charset->{set}; # base override
}
else {
Alert("Encoding <q>$input</q> unknown");
}
else {
Alert("Encoding <q>$input</q> unknown");
@@
-338,8
+349,8
@@
for my $row (@request) {
$visible->{$glyph}++;
}
$visible->{$glyph}++;
}
- say sprintf $class ? '<td title="%s" class="X %s">%s' : '<td title="%s">',
-
$name, $class, $cell
;
+ print '<td title="%s"', $name;
+
say $class ? sprintf(' class="X %s">%s', $class, $cell) : '>'
;
}
continue {
$offset += $colsize;
}
continue {
$offset += $colsize;