From: Jarkko Hietaniemi Date: Sun, 12 Aug 2001 18:43:50 +0000 (+0000) Subject: Mark tests (and one module) having explicit Latin-1 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=4c53e876b789c79a3c29f9f39f439b5326c8d417;p=p5sagit%2Fp5-mst-13.2.git Mark tests (and one module) having explicit Latin-1 (and one file having explicit UTF-8) with an explicit 'no utf8' (and one explicit 'use utf8'). NOTE: t/op/pat.t #64 fails mysteriously under 'use utf8'. p4raw-id: //depot/perl@11648 --- diff --git a/lib/CGI/t/html.t b/lib/CGI/t/html.t index 93e5dac..643bbde 100755 --- a/lib/CGI/t/html.t +++ b/lib/CGI/t/html.t @@ -15,6 +15,8 @@ use CGI (':standard','-no_debug','*h3','start_table'); $loaded = 1; print "ok 1\n"; +no utf8; # we contain Latin-1 + ######################### End of black magic. my $CRLF = "\015\012"; diff --git a/lib/Locale/Codes/t/languages.t b/lib/Locale/Codes/t/languages.t index 9facd35..c643f3a 100644 --- a/lib/Locale/Codes/t/languages.t +++ b/lib/Locale/Codes/t/languages.t @@ -10,7 +10,7 @@ BEGIN { use Locale::Language; -no utf8; # so that the naked 8-bit characters won't gripe under use utf8 +no utf8; # we contain Latin-1 #----------------------------------------------------------------------- # This is an array of tests. Each test is eval'd as an expression. diff --git a/lib/Locale/Language.pm b/lib/Locale/Language.pm index 391cffa..9e0cf19 100644 --- a/lib/Locale/Language.pm +++ b/lib/Locale/Language.pm @@ -247,13 +247,15 @@ modify it under the same terms as Perl itself. # initialisation code - stuff the DATA into the CODES hash #======================================================================= { + no utf8; # __DATA__ contains Latin-1 + my $code; my $language; while () { - next unless /\S/; + next unless /\S/; chop; ($code, $language) = split(/:/, $_, 2); $CODES{$code} = $language; diff --git a/lib/charnames.t b/lib/charnames.t index 124dad0..cc38221 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -117,7 +117,7 @@ sub to_bytes { { # 20001114.001 - no utf8; # so that the naked 8-bit character won't gripe under use utf8 + no utf8; # naked Latin-1 if (ord("Ä") == 0xc4) { # Try to do this only on Latin-1. use charnames ':full'; diff --git a/lib/locale.t b/lib/locale.t index b18ff41..3174fe1 100644 --- a/lib/locale.t +++ b/lib/locale.t @@ -719,19 +719,28 @@ foreach $Locale (@Locale) { $utf8skip{117}++; } else { use locale; - use locale; - no utf8; # so that the native 8-bit characters work + no utf8; my @f = (); foreach my $x (keys %UPPER) { my $y = lc $x; next unless uc $y eq $x; - push @f, $x unless $x =~ /$y/i && $y =~ /$x/i; + print "# UPPER $x lc $y ", + $x =~ /$y/i ? 1 : 0, " ", + $y =~ /$x/i ? 1 : 0, "\n" if 0; + # With utf8 both will fail since the locale concept + # of upper/lower does not work well in Unicode. + push @f, $x unless $x =~ /$y/i == $y =~ /$x/i; } foreach my $x (keys %lower) { my $y = uc $x; next unless lc $y eq $x; - push @f, $x unless $x =~ /$y/i && $y =~ /$x/i; + print "# lower $x uc $y ", + $x =~ /$y/i ? 1 : 0, " ", + $y =~ /$x/i ? 1 : 0, "\n" if 0; + # With utf8 both will fail since the locale concept + # of upper/lower does not work well in Unicode. + push @f, $x unless $x =~ /$y/i == $y =~ /$x/i; } tryneoalpha($Locale, 117, @f == 0); if (@f) { diff --git a/t/lib/locale/latin1 b/t/lib/locale/latin1 index f40f732..8499ca4 100644 --- a/t/lib/locale/latin1 +++ b/t/lib/locale/latin1 @@ -1,3 +1,4 @@ +no utf8; # naked Latin-1 $locales .= <