flag of the original scalar. Problem reported by Simon Cozens.
p4raw-id: //depot/perl@7164
AV *ary;
register I32 limit = POPi; /* note, negative is forever */
SV *sv = POPs;
+ bool isutf = DO_UTF8(sv);
STRLEN len;
register char *s = SvPV(sv, len);
char *strend = s + len;
sv_setpvn(dstr, s, m-s);
if (make_mortal)
sv_2mortal(dstr);
+ if (isutf)
+ (void)SvUTF8_on(dstr);
XPUSHs(dstr);
s = m + 1;
sv_setpvn(dstr, s, m-s);
if (make_mortal)
sv_2mortal(dstr);
+ if (isutf)
+ (void)SvUTF8_on(dstr);
XPUSHs(dstr);
s = m;
}
sv_setpvn(dstr, s, m-s);
if (make_mortal)
sv_2mortal(dstr);
+ if (isutf)
+ (void)SvUTF8_on(dstr);
XPUSHs(dstr);
s = m + 1;
}
sv_setpvn(dstr, s, m-s);
if (make_mortal)
sv_2mortal(dstr);
+ if (isutf)
+ (void)SvUTF8_on(dstr);
XPUSHs(dstr);
s = m + len; /* Fake \n at the end */
}
sv_setpvn(dstr, s, m-s);
if (make_mortal)
sv_2mortal(dstr);
+ if (isutf)
+ (void)SvUTF8_on(dstr);
XPUSHs(dstr);
if (rx->nparens) {
for (i = 1; i <= rx->nparens; i++) {
dstr = NEWSV(33, 0);
if (make_mortal)
sv_2mortal(dstr);
+ if (isutf)
+ (void)SvUTF8_on(dstr);
XPUSHs(dstr);
}
}
sv_setpvn(dstr, s, strend-s);
if (make_mortal)
sv_2mortal(dstr);
+ if (isutf)
+ (void)SvUTF8_on(dstr);
XPUSHs(dstr);
iters++;
}
}
}
-print "1..66\n";
+print "1..68\n";
my $test = 1;
ok_bytes chr(0xe2), pack("C*", 0xc3, 0xa2);
$test++; # 66
}
+
+{
+ use utf8;
+ my @a = map ord, split(//, join("", map chr, (1234, 123, 2345)));
+ ok "@a", "1234 123 2345";
+ $test++; # 67
+}
+
+{
+ use utf8;
+ my $x = chr(123);
+ my @a = map ord, split(/$x/, join("", map chr, (1234, 123, 2345)));
+ ok "@a", "1234 2345";
+ $test++; # 68
+}