# tries all locales it can find on the
# platform
my $locales_ref = shift;
+ return if !defined &POSIX::LC_CTYPE;
if (! defined $locales_ref) {
my @locales = find_locales(&POSIX::LC_CTYPE());
$locales_ref = \@locales;
}
use Config;
my $have_strtod = $Config{d_strtod} eq 'define';
-my @locales = find_locales( [ LC_ALL, LC_CTYPE, LC_NUMERIC ] );
+my @locales = eval { find_locales( [ &LC_ALL, &LC_CTYPE, &LC_NUMERIC ] ) };
skip_all("no locales available") unless @locales;
plan tests => &last;
is(fc("\x{1E9E}"), fc("\x{17F}\x{17F}"), 'fc("\x{1E9E}") eq fc("\x{17F}\x{17F}")');
SKIP: {
skip 'Can\'t find a UTF-8 locale', 1 unless defined $utf8_locale;
- setlocale(LC_CTYPE, $utf8_locale);
+ setlocale(&LC_CTYPE, $utf8_locale);
is(fc("\x{1E9E}"), "ss", 'fc("\x{1E9E}") eq "ss" in a UTF-8 locale)');
}
}
}
# These should match the UTF-8 locale values
- setlocale(LC_CTYPE, $utf8_locale);
+ setlocale(&LC_CTYPE, $utf8_locale);
use locale;
for (0..0xff) {
is(fc(chr), $unicode_fc[$_], "In a UTF-8 locale, fc(chr $_) is the same as official Unicode");