charset: ucd fallback for undigraphed characters
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 2 Jun 2009 10:30:24 +0000 (10:30 +0000)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 13 Oct 2009 22:38:42 +0000 (22:38 +0000)
charset.plp

index bc2a1ea..f9a773a 100644 (file)
@@ -140,6 +140,11 @@ for my $row (@request) {
                        if (defined (my $mnem = $di{ord $glyph})) {
                                $info = $diinfo->{$mnem};
                        }
                        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 = quote($string || $glyph);
                        my ($codepoint, $name, $prop, $script, $string) = @$info;
 
                        $glyph = quote($string || $glyph);