From 613abc6d16e99bd9834fe6afd79beb61a3a4734d Mon Sep 17 00:00:00 2001 From: Karl Williamson Date: Mon, 29 Dec 2014 13:15:57 -0700 Subject: Raise warning on multi-byte char in single-byte locale See http://nntp.perl.org/group/perl.perl5.porters/211909 Something is quite likely wrong with the logic if say in a Greek locale, Unicode characters (especially Greek ones) are encountered. The same character will be represented by two different code points. This warning alerts the user to this undesirable state of affairs. --- t/re/charset.t | 2 ++ t/re/pat_advanced.t | 1 + 2 files changed, 3 insertions(+) (limited to 't/re') diff --git a/t/re/charset.t b/t/re/charset.t index 4d0d99cfdc..e06191620d 100644 --- a/t/re/charset.t +++ b/t/re/charset.t @@ -9,6 +9,8 @@ BEGIN { use strict; use warnings; +no warnings 'locale'; # Some /l tests use above-latin1 chars to make sure + # they work, even though they warn. use Config; plan('no_plan'); diff --git a/t/re/pat_advanced.t b/t/re/pat_advanced.t index c210e2e06e..19d6fbce07 100644 --- a/t/re/pat_advanced.t +++ b/t/re/pat_advanced.t @@ -866,6 +866,7 @@ sub run_tests { ok "\x{100}X" =~ /$re/, "S_cl_and ANYOF_UNICODE & ANYOF_INVERTED"; my $loc_re = qq /(?l:^([^X]*)X)/; utf8::upgrade ($loc_re); + no warnings 'locale'; ok "\x{100}X" =~ /$loc_re/, "locale, S_cl_and ANYOF_UNICODE & ANYOF_INVERTED"; } -- cgit v1.2.1