Subject: Re: utf8 regexp performance problem
Message-ID: <
9b18b3110610200338k5df1d3afpf829fbc0f3663a75@mail.gmail.com>
p4raw-id: //depot/perl@29063
TAINT_NOT;
sv_setpvn(sv, s, i);
PL_tainted = oldtainted;
- if (RX_MATCH_UTF8(rx) && (!i || is_utf8_string((U8*)s, i)))
+ if ( (rx->reganch & ROPT_CANY_SEEN)
+ ? (RX_MATCH_UTF8(rx)
+ && (!i || is_utf8_string((U8*)s, i)))
+ : (RX_MATCH_UTF8(rx)) )
+ {
SvUTF8_on(sv);
+ }
else
SvUTF8_off(sv);
if (PL_tainting) {