--- /dev/null
+<:
+use utf8;
+use strict;
+use warnings;
+use open IO => ':utf8';
+
+our $VERSION = '1.0';
+
+$header{content_type} = 'text/html; charset=utf-8';
+
+:><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
+ "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+
+<head>
+<title>charset cheat sheet</title>
+<meta http-equiv="content-type" content="utf-8">
+<link rel="stylesheet" type="text/css" media="all" href="/base.css">
+</head>
+
+<body>
+<h1>Character encoding</h1>
+
+<:
+my $diinfo = do 'digraphs.inc.pl';
+my %di = map { $diinfo->{$_}->[0] => $_ } grep { ref $diinfo->{$_} }
+ keys %$diinfo;
+
+use Encode qw(decode);
+# generate character table(s)
+# (~16x faster than decoding in loop;
+# substr strings is twice as fast as splitting to an array)
+my @tables = map { decode($_, pack 'C*', 0..255) } 'iso-8859-1';
+my $NOCHAR = chr 0xFFFD;
+
+sub quote {
+ local $_ = shift;
+ s/"/"/g;
+ s/</</g;
+ s/>/>/g;
+ return $_;
+}
+
+my @nibble = (0..9, 'A'..'F');
+for my $table (@tables) {
+ print '<table class="glyphs"><col>';
+ for my $section (qw{thead tfoot}) {
+ print "<$section><tr><th>↳";
+ print '<th>', $_ for @nibble;
+ print "<th> \n";
+ }
+ print '<tbody>';
+ for my $msb (0 .. $#nibble) {
+ print '<tr><th>', $nibble[$msb];
+ for my $lsb (0 .. $#nibble) {
+ my $glyph = substr $table, ($msb<<4) + $lsb, 1;
+ if ($glyph eq $NOCHAR) {
+ print '<td>';
+ 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 = "<span>$glyph</span>" if $prop eq 'Zs';
+
+ printf "\n".'<td class="%s" title="%s">%s',
+ join(' ', @class), quote($desc), $glyph;
+ }
+ print "\n<th>", $nibble[$msb], "\n";
+ }
+ print "</table>\n";
+}
+
'^h' => ["back$sign{_}space", "co"],
'^i' => ["tab", "co"],
'^j' => ["enter", "co"],
- '^k' => ["di$sign{_}graph", "co arg arg vim linkdigraphs.plp", "Key code"],
+ '^k' => ["di$sign{_}graph", 'co arg arg vim linkdigraphs', "Key code"],
'^l' => ["<em>im</em> leave ins mode", "mo mode vim"], # insertmode only
'^m' => ["enter", "co"],
'^n' => ["find next keyword", "pm vim"],
'^s' => "^s",
'^t' => ["indent", "co"],
'^u' => ["delete line", "co"],
- '^v' => ["literal or ch$sign{_}ar$sign{_}cod$sign{_}e", 'co', "Verbatim or by Value"],
+ '^v' => ["literal or ch$sign{_}ar$sign{_}cod$sign{_}e", 'co linkcharset', "Verbatim or by Value"],
'^w' => ["delete word back", "co"],
'^x' => ["ex$sign{_}pand mode", 'me arg modei^x vim'],
'^y' => ["ins char above", "co vim"],