X-Git-Url: http://git.shiar.net/sheet.git/blobdiff_plain/1d37e00ff50c4cee3f23749febcfe6e33e1f608a..fc33639e320c49693604bf0e259a29a07f2076b4:/charset.plp
diff --git a/charset.plp b/charset.plp
index bce918b..98a7345 100644
--- a/charset.plp
+++ b/charset.plp
@@ -1,30 +1,26 @@
-<:
-use utf8;
-use strict;
-use warnings;
-use open IO => ':utf8';
-
-our $VERSION = 'v1.0';
-
-$header{content_type} = 'text/html; charset=utf-8';
-
-:>
-
+<(common.inc.plp)><:
+
+Html({
+ title => 'charset cheat sheet',
+ version => 'v1.0',
+ description => [
+ "Reference sheet with all glyphs in common character encoding tables,",
+ "and an overview of Unicode ranges and UTF-8 bytes.",
+ ],
+ keywords => [qw'
+ charset codepage unicode ascii utf8 latin glyph character encoding
+ reference common overview table
+ '],
+ stylesheet => [qw'light'],
+ data => [qw'charset-unicode.inc.pl charset-utf8.inc.pl'],
+});
-
-charset cheat sheet
-
-
-
-
-
+:>
Character encoding
<:
-my $diinfo = do 'digraphs.inc.pl';
-my %di = map { $diinfo->{$_}->[0] => $_ } grep { ref $diinfo->{$_} }
- keys %$diinfo;
+use Shiar_Sheet::FormatChar;
+my $glyphs = Shiar_Sheet::FormatChar->new;
use Encode qw(decode resolve_alias);
# generate character table(s)
@@ -68,7 +64,7 @@ my @request = map {
}
elsif ($row{set} = resolve_alias($input)) {
if ($row{set} eq 'Internal') {
- $row{table} = ' ' x ($endpoint < 255 ? 640 : 4096);
+ $row{table} = ' ' x ($endpoint < 255 ? 640 : 8192);
$row{set} = 'Unicode BMP';
$row{cell} = do 'charset-unicode.inc.pl';
}
@@ -101,21 +97,11 @@ for my $cp437 (grep {$request[$_]->{set} eq 'cp437'} 0 .. $#request) {
);
}
-sub quote {
- local $_ = shift;
- s/"/"/g;
- s/</g;
- s/>/>/g;
- return $_;
-}
-
-print "\n";
-
my @nibble = (0..9, 'A'..'F');
for my $row (@request) {
- printf '', !$row->{cell} && ' charmap';
+ printf '', !$row->{cell} && ' charmap';
printf '%s', $row->{set};
- print '';
+ print '' x 17;
for my $section (qw{thead}) {
print "<$section>â±";
print ' | ', $_ for @nibble;
@@ -136,28 +122,13 @@ for my $row (@request) {
next;
}
- my $info = [ord $glyph];
- if (defined (my $mnem = $di{ord $glyph})) {
- $info = $diinfo->{$mnem};
- }
- my ($codepoint, $name, $prop, $script, $string) = @$info;
-
- $glyph = quote($string || $glyph);
- my $desc = sprintf 'U+%04X%s', $codepoint, $name && " ($name)";
- my @class = ('X', grep {$_} $prop, $script);
-
- $glyph = "$glyph" if $prop eq 'Zs';
-
- printf "\n".' | %s',
- join(' ', @class), quote($desc), $glyph;
+ print "\n".$glyphs->glyph_cell($glyph);
}
print "\n";
}
- print " |
---|
\n";
+ print "
\n";
}
-print "
\n";
-
:>
@@ -194,7 +165,7 @@ print "\n";
- unicode 5.0
+ | unicode 7.0
| proposed
| deprecated
| unassigned
@@ -202,12 +173,3 @@ print "\n";
|
-
-
-