This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/loc_tools.pl: Only try C.UTF-8 if Configure says avail
authorKarl Williamson <khw@cpan.org>
Mon, 4 Mar 2019 18:56:05 +0000 (11:56 -0700)
committerKarl Williamson <khw@cpan.org>
Mon, 4 Mar 2019 20:01:37 +0000 (13:01 -0700)
I added a Configure probe for this capability, since some platforms will
say yes to any locale name, so we can't really test for it in perl.

t/loc_tools.pl

index 4b80ed5..f8edaad 100644 (file)
@@ -337,7 +337,11 @@ sub find_locales ($;$) {
     my @Locale;
     _trylocale("C", $categories, \@Locale, $allow_incompatible);
     _trylocale("POSIX", $categories, \@Locale, $allow_incompatible);
-    _trylocale("C.UTF-8", $categories, \@Locale, $allow_incompatible);
+
+    if ($Config{d_has_C_UTF8} eq 'true') {
+        _trylocale("C.UTF-8", $categories, \@Locale, $allow_incompatible);
+    }
+
     foreach (1..16) {
         _trylocale("ISO8859-$_", $categories, \@Locale, $allow_incompatible);
         _trylocale("iso8859$_", $categories, \@Locale, $allow_incompatible);