Message-Id: <
200402090321.i193LL907950@zen.crypt.org>
p4raw-id: //depot/perl@22292
continue; /* not "break" */
}
+ /* calculate width before utf8_upgrade changes it */
+ have = esignlen + zeros + elen;
+
if (is_utf8 != has_utf8) {
if (is_utf8) {
if (SvCUR(sv))
"Newline in left-justified string for %sprintf",
(PL_op->op_type == OP_PRTF) ? "" : "s");
- have = esignlen + zeros + elen;
need = (have > width ? have : width);
gap = need - have;
require './test.pl';
}
-plan tests => 2;
+plan tests => 3;
is(
sprintf("%.40g ",0.01),
sprintf("%.40f", 0.01)." ",
q(the sprintf "%.<number>f" optimization)
);
+{
+ chop(my $utf8_format = "%-3s\x{100}");
+ is(
+ sprintf($utf8_format, "\xe4"),
+ "\xe4 ",
+ q(width calculation under utf8 upgrade)
+ );
+}