Skip to content

Commit e8954fb

Browse files
committed
loc_tools.pl: Add ability to skip known bad locales
Some platforms have locales that shouldn't be used. This adds code to avoid using such when looking at all the locales on a platform. The next commit will add the first use.
1 parent e0d608e commit e8954fb

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

t/loc_tools.pl

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@
1515
use warnings;
1616
use feature 'state';
1717

18+
my %known_bad_locales = ( # XXX eventually will need version info if and
19+
# when these get fixed.
20+
);
21+
1822
eval { require POSIX; import POSIX 'locale_h'; };
1923
my $has_locale_h = ! $@;
2024

@@ -157,6 +161,11 @@ ($$$$)
157161
return if defined $Config{d_setlocale_accepts_any_locale_name}
158162
&& $locale !~ / ^ (?: C | POSIX | C\.UTF-8 ) $/ix;
159163

164+
if (exists $known_bad_locales{$^O}) {
165+
my @bad_locales = $known_bad_locales{$^O}->@*;
166+
return if grep { $locale eq $_ } @bad_locales;
167+
}
168+
160169
$categories = [ $categories ] unless ref $categories;
161170

162171
my $badutf8 = 0;

0 commit comments

Comments
 (0)