From fff7535cca3d7faa5b59aa82de74bd71e938ea92 Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Thu, 17 Mar 2011 13:55:35 -0600 Subject: [PATCH] charset.t: Skip locale tests depending on platform The locale tests in this file assume that the code points 128-255 are not printable, etc in the C locale. Some platforms do not conform to that so test at the beginning for that. --- t/re/charset.t | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/t/re/charset.t b/t/re/charset.t index 938ec15..4b64725 100644 --- a/t/re/charset.t +++ b/t/re/charset.t @@ -38,7 +38,17 @@ my @charsets = qw(a d u); if (! is_miniperl()) { require POSIX; my $current_locale = POSIX::setlocale( &POSIX::LC_ALL, "C") // ""; - push @charsets, 'l' if $current_locale eq 'C'; + if ($current_locale eq 'C') { + use locale; + + # Some locale implementations don't have the 128-255 characters all + # mean nothing. Skip the locale tests in that situation + for my $i (128 .. 255) { + goto bad_locale if chr($i) =~ /[[:print:]]/; + } + push @charsets, 'l'; + bad_locale: + } } # For each possible character set... -- 2.7.4