1;
} or warn "Failed reading unicode tables: $@";
+eval {
+ require HTML::Entities;
+ while (my ($char, $entity) = each %HTML::Entities::char2entity) {
+ $entity =~ /[a-zA-Z]/ or next; # only actual aliases
+ $info{$char}->{html} = substr($entity, 1, -1);
+ }
+ 1;
+} or warn "Failed importing html entities: $@";
+
my %diinc = (
'digraphs.inc.pl' => 'u-di',
);
|| { block => '?', category => 'Xn', name => '', script => '' }
} or next;
- $info->{$_} = $info{$chr}->{$_} for qw(di class string);
+ $info->{$_} = $info{$chr}->{$_} for qw(di html class string);
# categorise by unicode types and writing script
$info->{class}->{$_}++ for $info->{category};
for my $cp (sort keys %info) {
$info{$cp}->{classstr} = join(' ', sort keys %{ $info{$cp}->{class} });
# convert info hashes into arrays of strings to output in display order
- my $row = [ map { $info{$cp}->{$_} } qw/classstr name di string/ ];
+ my $row = [ map { $info{$cp}->{$_} } qw/classstr name di html string/ ];
# strip off trailing missing values (especially string may be unknown)
defined $row->[-1] ? last : pop @$row for 1 .. @$row;
# final line (assume safe within single quotes)