From: Andreas König Date: Tue, 8 Jan 2002 14:12:29 +0000 (+0100) Subject: Not OK 13843 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=5b71a6a7d9a57910f8176799ca3a0c2e2cc65133;p=p5sagit%2Fp5-mst-13.2.git Not OK 13843 Message-ID: p4raw-id: //depot/perl@14135 --- diff --git a/op.c b/op.c index 509569e..e4f84fa 100644 --- a/op.c +++ b/op.c @@ -3131,7 +3131,7 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, OP *repl) p = SvPV(pat, plen); pm->op_pmflags |= PMf_SKIPWHITE; } - if (DO_UTF8(pat) || (PL_hints & HINT_UTF8)) + if (DO_UTF8(pat)) pm->op_pmdynflags |= PMdf_UTF8; PM_SETRE(pm, CALLREGCOMP(aTHX_ p, p + plen, pm)); if (strEQ("\\s+", PM_GETRE(pm)->precomp)) @@ -3139,8 +3139,6 @@ Perl_pmruntime(pTHX_ OP *o, OP *expr, OP *repl) op_free(expr); } else { - if (PL_hints & HINT_UTF8) - pm->op_pmdynflags |= PMdf_UTF8; if (pm->op_pmflags & PMf_KEEP || !(PL_hints & HINT_RE_EVAL)) expr = newUNOP((!(PL_hints & HINT_RE_EVAL) ? OP_REGCRESET diff --git a/t/op/subst.t b/t/op/subst.t index e5eb85b..e48a1b3 100755 --- a/t/op/subst.t +++ b/t/op/subst.t @@ -7,7 +7,7 @@ BEGIN { } require './test.pl'; -plan( tests => 87 ); +plan( tests => 88 ); $x = 'foo'; $_ = "x"; @@ -365,3 +365,12 @@ ok( !s/^([a-z]:)/\u$1/ ); $_ = "Charles Bronson"; $snum = s/\B\w//g; ok( $_ eq "C B" && $snum == 12 ); + +{ + use utf8; + my $s = "H\303\266he"; + my $l = my $r = $s; + $l =~ s/[^\w]//g; + $r =~ s/[^\w\.]//g; + is($l, $r, "use utf8"); +}