- my $info = [ord $glyph];
- if (defined (my $mnem = $di{ord $glyph})) {
- $info = $diinfo->{$mnem};
- }
- else {
- require Unicode::UCD;
- my $fullinfo = Unicode::UCD::charinfo(ord $glyph);
- $info = [@$fullinfo{qw/code name category script string/}] if $fullinfo;
- }
- my ($codepoint, $name, $prop, $script, $string) = @$info;
-
- $glyph = EscapeHTML($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), EscapeHTML($desc), $glyph;