Subject: | LATIN SMALL LETTER DOTLESS I |
Text::Undiacritic doesn't convert \N{LATIN SMALL LETTER DOTLESS I} to
\N{LATIN SMALL LETTER I}
Test to confirm bug attached, as well as patch.
Subject: | dotless_i.patch |
diff -ur Text-Undiacritic-0.02/lib/Text/Undiacritic.pm Text-Undiacritic/lib/Text/Undiacritic.pm
--- Text-Undiacritic-0.02/lib/Text/Undiacritic.pm 2007-12-09 15:02:50.000000000 +0000
+++ Text-Undiacritic/lib/Text/Undiacritic.pm 2010-08-13 12:49:42.097479499 +0100
@@ -25,6 +25,7 @@
my $name = charnames::viacode( ord $character );
$name =~ s/\s WITH \s .+ \z//xms;
+ $name =~ s/\s DOTLESS \s/ /xms;
$undiacritics .= chr charnames::vianame( $name );
}
Subject: | dotless_i.t |
#!/usr/bin/perl
use strict;
use warnings;
use Text::Undiacritic v0.02 qw( undiacritic );
use charnames qw( :full );
use Test::More;
my %undiacritic = (
'LATIN SMALL LETTER DOTLESS I' => 'LATIN SMALL LETTER I',
);
plan tests => scalar keys %undiacritic;
while ( my ( $before, $after ) = each %undiacritic ) {
is(
undiacritic( chr charnames::vianame($before) ),
chr charnames::vianame($after),
qq{"$before" => "$after"}
);
}