char *pat = SvPV(*sarg, patlen);
bool do_taint = FALSE;
+ SvUTF8_off(sv);
if (DO_UTF8(*sarg))
SvUTF8_on(sv);
sv_vsetpvfn(sv, pat, patlen, Null(va_list*), sarg + 1, len - 1, &do_taint);
require "test.pl";
}
-plan tests => 23;
+plan tests => 25;
$a = "B\x{fc}f";
$b = "G\x{100}r";
is((sprintf "%x %x %d", unpack("U*", $a), length($a)), "1234 5678 2",
'\x{1234}%s \x{5678}');
}
+
+{
+ # check that utf8ness doesn't "accumulate"
+
+ my $w = "w\x{fc}";
+ my $sprintf;
+
+ $sprintf = sprintf "%s%s", $w, "$w\x{100}";
+ is(substr($sprintf,0,2), $w, "utf8 echo");
+
+ $sprintf = sprintf "%s%s", $w, "$w\x{100}";
+ is(substr($sprintf,0,2), $w, "utf8 echo echo");
+}