setlocale(LC_ALL, "C");
-sub utf8locale { $_[0] =~ /utf-?8/i }
-
@Locale = sort @Locale;
debug "# Locales = @Locale\n";
# Test \w.
- if (utf8locale($Locale)) {
- # Until the polymorphic regexen arrive.
- debug "# skipping UTF-8 locale '$Locale'\n";
- } else {
- my $word = join('', @Neoalpha);
+ my $word = join('', @Neoalpha);
- $word =~ /^(\w+)$/;
+ $word =~ /^(\w+)$/;
- tryneoalpha($Locale, 99, $1 eq $word);
- }
+ tryneoalpha($Locale, 99, $1 eq $word);
# Cross-check the whole 8-bit character set.
# Does lc of an UPPER (if different from the UPPER) match
# case-insensitively the UPPER, and does the UPPER match
# case-insensitively the lc of the UPPER. And vice versa.
- if (utf8locale($Locale)) {
- # Until the polymorphic regexen arrive.
- debug "# skipping UTF-8 locale '$Locale'\n";
- } else {
- use locale;
-
- my @f = ();
- foreach my $x (keys %UPPER) {
- my $y = lc $x;
- next unless uc $y eq $x;
- push @f, $x unless $x =~ /$y/i && $y =~ /$x/i;
- }
- foreach my $x (keys %lower) {
- my $y = uc $x;
- next unless lc $y eq $x;
- push @f, $x unless $x =~ /$y/i && $y =~ /$x/i;
- }
- tryneoalpha($Locale, 116, @f == 0);
+ {
+ use locale;
+ no utf8; # so that the native 8-bit characters work
+
+ my @f = ();
+ foreach my $x (keys %UPPER) {
+ my $y = lc $x;
+ next unless uc $y eq $x;
+ push @f, $x unless $x =~ /$y/i && $y =~ /$x/i;
+ }
+ foreach my $x (keys %lower) {
+ my $y = uc $x;
+ next unless lc $y eq $x;
+ push @f, $x unless $x =~ /$y/i && $y =~ /$x/i;
+ }
+ tryneoalpha($Locale, 116, @f == 0);
if (@f) {
print "# failed 116 locale '$Locale' characters @f\n"
}
}
-
}
# Recount the errors.