vecsv = svix < svmax ? svargs[svix++] : &PL_sv_undef;
}
dotstr = SvPV_const(vecsv, dotstrlen);
+ /* Keep the DO_UTF8 test *after* the SvPV call, else things go
+ bad with tied or overloaded values that return UTF8. */
if (DO_UTF8(vecsv))
is_utf8 = TRUE;
+ else if (has_utf8) {
+ vecsv = sv_mortalcopy(vecsv);
+ sv_utf8_upgrade(vecsv);
+ dotstr = SvPV_const(vecsv, dotstrlen);
+ is_utf8 = TRUE;
+ }
}
if (args) {
VECTORIZE_ARGS
require "test.pl";
}
-plan tests => 25;
+plan tests => 52;
$a = "B\x{fc}f";
$b = "G\x{100}r";
$sprintf = sprintf "%s%s", $w, "$w\x{100}";
is(substr($sprintf,0,2), $w, "utf8 echo echo");
}
+
+my @values =(chr 110, chr 255, chr 256);
+
+foreach my $prefix (@values) {
+ foreach my $vector (map {$_ . $_} @values) {
+
+ my $format = "$prefix%*vd";
+
+ foreach my $dot (@values) {
+ my $result = sprintf $format, $dot, $vector;
+ is (length $result, 8)
+ or print "# ", join (',', map {ord $_} $prefix, $dot, $vector),
+ "\n";
+ }
+ }
+}