This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
t/run/locale.t: Silence perl warning
authorKarl Williamson <khw@cpan.org>
Wed, 18 Apr 2018 23:44:04 +0000 (17:44 -0600)
committerKarl Williamson <khw@cpan.org>
Wed, 18 Apr 2018 23:49:44 +0000 (17:49 -0600)
This pattern that contains [:ascii:] is executed under /l, and can raise
"wide character" warnings when matched against a UTF-8 string.  But we
really are interested in strict ASCII, so /u works perfectly and avoids
any such warnings.

t/run/locale.t

index 48c0ae3..13bc25d 100644 (file)
@@ -135,7 +135,7 @@ EOF
             # For utf8 locales with a non-ascii radix, it should be encoded as
             # UTF-8 with the internal flag so set.
             if (! defined $utf8_radix
-                && $radix =~ /[[:^ascii:]]/
+                && $radix =~ /[[:^ascii:]]/u  # /u because /l can raise warnings
                 && is_locale_utf8($_))
             {
                 $utf8_radix = $_;