+for my $c1group (@chars) {
+ print '<tbody>';
+ for my $c1 (@$c1group) {
+ print '<tr><th>', EscapeHTML($c1);
+ for my $c2 (map {@$_} @chars2) {
+ my $mnem = $c1 . $c2;
+ if (not defined $di->{$mnem}) {
+ print '<td>';
+ next;
+ }
+ if (ref $di->{$mnem} ne 'ARRAY') {
+ printf '<td class="X Xr" title="%s">', EscapeHTML($mnem);
+ next;
+ }
+ my ($codepoint, $name, $prop, $script, $string) = @{ $di->{$mnem} };
+
+ my $glyph = $string || chr $codepoint;
+ utf8::upgrade($glyph); # prevent latin1 output
+ my $desc = $mnem . ($name && " ($name)");
+ my @class = ('X', grep {$_} $prop, $script);
+
+ $glyph = EscapeHTML($glyph);
+ $glyph = "<span>$glyph</span>" if $prop eq 'Zs';
+
+ printf "\n".'<td class="%s" title="%s">%s',
+ join(' ', @class), EscapeHTML($desc), $glyph;