p4raw-id: //depot/perl@9193
char *s = rx->subbeg + s1;
char *send = rx->subbeg + t1;
- i = Perl_utf8_length(aTHX_ (U8*)s, (U8*)send);
+ i = t1 - s1;
+ if (is_utf8_string((U8*)s, i))
+ i = Perl_utf8_length(aTHX_ (U8*)s, (U8*)send);
}
if (i < 0)
Perl_croak(aTHX_ "panic: magic_len: %"IVdf, (IV)i);
PL_tainted = FALSE;
}
sv_setpvn(sv, s, i);
- if (DO_UTF8(PL_reg_sv))
+ if (DO_UTF8(PL_reg_sv) && is_utf8_string((U8*)s, i))
SvUTF8_on(sv);
else
SvUTF8_off(sv);
$_ = "a\x{100}b";
if (/(.)(\C)(\C)(.)/) {
print "ok 232\n";
- # currently \C are still tagged as UTF-8
- use bytes;
if ($1 eq "a") {
print "ok 233\n";
} else {
if (/(\C)/g) {
print "ok 237\n";
# currently \C are still tagged as UTF-8
- use bytes;
if ($1 eq "\xC4") {
print "ok 238\n";
} else {
if (/(\C)/g) {
print "ok 239\n";
# currently \C are still tagged as UTF-8
- use bytes;
if ($1 eq "\x80") {
print "ok 240\n";
} else {
}
} else {
for (244..245) {
- print "ok $_ # Skip: not EBCDIC\n";
+ print "ok $_ # Skip: only in EBCDIC\n";
}
}