At the start of the function, it marks the output as being utf8 if the
first arg is utf8. But this should be taken care of when the individual
args (including the first one are processed). So its redundant code.
In fact it would sometimes cause the resultant string to be unnecessarily
upgraded to utf8, e.g.:
my $precis = "9";
utf8::upgrade($precis);
my $s = sprintf "%.*f\n", $precis, 1.1;
# whoops, $s is now utf8
}
#endif /* !USE_LONG_DOUBLE */
- if (!args && svix < svmax && DO_UTF8(*svargs))
- has_utf8 = TRUE;
-
patend = (char*)pat + patlen;
for (p = (char*)pat; p < patend; p = q) {
is($w_other, 0, "utf8 for invalid format: other warnings");
}
+# it used to upgrade the result to utf8 if the 1st arg happened to be utf8
+
+{
+ my $precis = "9";
+ utf8::upgrade($precis);
+ my $s = sprintf "%.*f\n", $precis, 1.1;
+ ok(!utf8::is_utf8($s), "first arg not special utf8-wise");
+}
+
+
done_testing();