diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-04-10 04:18:45 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-04-10 04:18:45 +0000 |
commit | 5fef21a34e2a36dc7c83d55110ccc5c57cc7d14d (patch) | |
tree | 8fd40ce885677867d628d94dbb6f4c8335c87a5b /lib/locale.t | |
parent | 1da2899b25b80b668761486331f7dffeeea2be83 (diff) | |
download | perl-5fef21a34e2a36dc7c83d55110ccc5c57cc7d14d.tar.gz |
Also locale names can contain illegal UTF-8.
p4raw-id: //depot/perl@19176
Diffstat (limited to 'lib/locale.t')
-rw-r--r-- | lib/locale.t | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/locale.t b/lib/locale.t index 7b27330972..2143b9f874 100644 --- a/lib/locale.t +++ b/lib/locale.t @@ -523,7 +523,17 @@ foreach $Locale (@Locale) { my $word = join('', @Neoalpha); - if ($Locale =~ /utf-?8/i) { + my $badutf8; + { + local $SIG{__WARN__} = sub { + $badutf8 = $_[0] =~ /Malformed UTF-8/; + }; + $Locale =~ /utf-?8/i; + } + + if ($badutf8) { + debug "# Locale name contains bad UTF-8, skipping test 99 for locale '$Locale'\n"; + } elsif ($Locale =~ /utf-?8/i) { debug "# unknown whether locale and Unicode have the same \\w, skipping test 99 for locale '$Locale'\n"; push @{$Okay{99}}, $Locale; } else { |