debug "is utf8 locale? = $is_utf8_locale\n";
- my $radix = localeconv()->{decimal_point};
- if ($radix !~ / ^ [[:ascii:]] + $/x) {
- use bytes;
- $radix = disp_chars(split "", $radix);
- }
- debug "radix = $radix\n";
+ debug "radix = " . disp_str(localeconv()->{decimal_point}) . "\n";
if (! $is_utf8_locale) {
use locale;
# Look for non-ASCII error messages, and verify that the first
# such is in UTF-8 (the others almost certainly will be like the
- # first).
+ # first). This is only done if the current locale has LC_MESSAGES
$ok14 = 1;
$ok14_5 = 1;
- foreach my $err (keys %!) {
- use Errno;
- $! = eval "&Errno::$err"; # Convert to strerror() output
- my $strerror = "$!";
- if ("$strerror" =~ /\P{ASCII}/) {
- $ok14 = utf8::is_utf8($strerror);
- no locale;
- $ok14_5 = "$!" !~ /\P{ASCII}/;
- last;
+ if (setlocale(&POSIX::LC_MESSAGES, $Locale)) {
+ foreach my $err (keys %!) {
+ use Errno;
+ $! = eval "&Errno::$err"; # Convert to strerror() output
+ my $strerror = "$!";
+ if ("$strerror" =~ /\P{ASCII}/) {
+ $ok14 = utf8::is_utf8($strerror);
+ no locale;
+ $ok14_5 = "$!" !~ /\P{ASCII}/;
+ last;
+ }
}
}
$ok18 = $j eq sprintf("%g:%g", $h, $i);
}
- { # These tests aren't affected by :not_characters
-
+ $ok19 = $ok20 = 1;
+ if (setlocale(&POSIX::LC_TIME, $Locale)) { # These tests aren't affected by
+ # :not_characters
my @times = CORE::localtime();
use locale;
$ok19 = POSIX::strftime("%p", @times) ne "%p"; # [perl #119425]
- my $date = POSIX::strftime("%A %B %Z", @times);
+ my $date = POSIX::strftime("'%A' '%B' '%Z' '%p'", @times);
+ debug("'Day' 'Month' 'TZ' 'am/pm' = ", disp_str($date));
# If there is any non-ascii, it better be UTF-8 in a UTF-8 locale, and
# not UTF-8 if the locale isn't UTF-8.
report_result($Locale, ++$locales_test_number, $ok20);
$test_names{$locales_test_number} = 'Verify that strftime returns date with UTF-8 flag appropriately set';
+ $problematical_tests{$locales_test_number} = 1; # This is broken in
+ # OS X 10.9.3
report_result($Locale, ++$locales_test_number, $ok21);
$test_names{$locales_test_number} = '"$!" is ASCII only outside of locale scope';
print "# problem is not likely to be Perl's\n";
}
}
- elsif ($debug) {
+ if ($debug) {
print "# $percent_fail% of locales (",
scalar(keys $Problem{$test_num}),
" of ",
scalar(@Locale),
- ") fail the following test\n";
+ ") fail the above test (TODO cut-off is ",
+ $acceptable_failure_percentage,
+ "%)\n";
}
}
print "#\n";