summaryrefslogtreecommitdiff
path: root/lib/locale.t
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2002-01-27 23:47:42 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2002-01-27 23:47:42 +0000
commit047e14fb14c84dbcdfa216825b9c92a8b1e79b9f (patch)
treea3acda651d536e447a2c1ecc0e677baf0451d545 /lib/locale.t
parentb53432e421f16fabc5e5530a1e2ce8c38d941676 (diff)
downloadperl-047e14fb14c84dbcdfa216825b9c92a8b1e79b9f.tar.gz
A bug in Bulgarian EBCDIC locale (this sounds like
a Sherlock Holmes mystery...) Well, a few more EBCDICs locales failed, too. The patch works around the bug by skipping the test, but the real problem may be deeper (affecting probably only EBCDIC platforms, though): see the comment in locale.t for more details. p4raw-id: //depot/perl@14455
Diffstat (limited to 'lib/locale.t')
-rw-r--r--lib/locale.t22
1 files changed, 22 insertions, 0 deletions
diff --git a/lib/locale.t b/lib/locale.t
index 3174fe141a..f90a9f1f8b 100644
--- a/lib/locale.t
+++ b/lib/locale.t
@@ -720,6 +720,7 @@ foreach $Locale (@Locale) {
} else {
use locale;
no utf8;
+ my $re = qr/[\[\(\{\*\+\?\|\^\$\\]/;
my @f = ();
foreach my $x (keys %UPPER) {
@@ -728,6 +729,23 @@ foreach $Locale (@Locale) {
print "# UPPER $x lc $y ",
$x =~ /$y/i ? 1 : 0, " ",
$y =~ /$x/i ? 1 : 0, "\n" if 0;
+ # If $x and $y contain regular expression characters
+ # AND THEY lowercase (/i) to regular expression characters,
+ # regcomp() will be mightily confused. No, the \Q doesn't
+ # help here (maybe regex engine internal lowercasing
+ # is done after the \Q?) An example of this happening is
+ # the bg_BG (Bulgarian) locale under EBCDIC (OS/390 USS):
+ # the chr(173) (the "[") is the lowercase of the chr(235).
+ # Similarly losing EBCDIC locales include cs_cz, cs_CZ,
+ # el_gr, el_GR, en_us.IBM-037 (!), en_US.IBM-037,
+ # et_ee, et_EE, hr_hr, hr_HR, hu_hu, hu_HU, lt_LT,
+ # mk_mk, mk_MK, nl_nl.IBM-037, nl_NL.IBM-037,
+ # pl_pl, pl_PL, ro_ro, ro_RO, ru_ru, ru_RU,
+ # sk_sk, sk_SK, sl_si, sl_SI, tr_tr, tr_TR,
+ if ($x =~ $re || $y =~ $re) {
+ print "# Regex characters in '$x' or '$y', skipping test 117 for locale '$Locale'\n";
+ next;
+ }
# 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;
@@ -738,6 +756,10 @@ foreach $Locale (@Locale) {
print "# lower $x uc $y ",
$x =~ /$y/i ? 1 : 0, " ",
$y =~ /$x/i ? 1 : 0, "\n" if 0;
+ if ($x =~ $re || $y =~ $re) { # See above.
+ print "# Regex characters in '$x' or '$y', skipping test 117 for locale '$Locale'\n";
+ next;
+ }
# 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;