The Search::Dict look() function should use the lc() function instead
of tr/A-Z/a-z/. This will make folding of non-english letters work if
the locale is set up correctly.
my($size, $blksize) = @stat[7,11];
$blksize ||= 8192;
$key =~ s/[^\w\s]//g if $dict;
- $key =~ tr/A-Z/a-z/ if $fold;
+ $key = lc $key if $fold;
my($min, $max, $mid) = (0, int($size / $blksize));
while ($max - $min > 1) {
$mid = int(($max + $min) / 2);
$_ = <FH>;
chop;
s/[^\w\s]//g if $dict;
- tr/A-Z/a-z/ if $fold;
+ $_ = lc $_ if $fold;
if (defined($_) && $_ lt $key) {
$min = $mid;
}
or last;
chop;
s/[^\w\s]//g if $dict;
- y/A-Z/a-z/ if $fold;
+ $_ = lc $_ if $fold;
last if $_ ge $key;
}
seek(FH,$min,0);