Change 11691 by jhi@alpha on 2001/08/16 11:46:02
Fix for 20010407.008 sprintf removes utf8-ness.
Affected files ...
... //depot/perl/pp.c#295 edit
... //depot/perl/t/op/misc.t#79 edit
Differences ...
==== //depot/perl/pp.c#295 (text) ====
Index: perl/pp.c
--- perl/pp.c.~1~ Thu Aug 16 06:00:05 2001
+++ perl/pp.c Thu Aug 16 06:00:05 2001
@@ -2933,6 +2933,8 @@
dSP; dMARK; dORIGMARK; dTARGET;
do_sprintf(TARG, SP-MARK, MARK+1);
TAINT_IF(SvTAINTED(TARG));
+ if (DO_UTF8(*(MARK+1)))
+ SvUTF8_on(TARG);
SP = ORIGMARK;
PUSHTARG;
RETURN;
==== //depot/perl/t/op/misc.t#79 (xtext) ====
Index: perl/t/op/misc.t
--- perl/t/op/misc.t.~1~ Thu Aug 16 06:00:05 2001
+++ perl/t/op/misc.t Thu Aug 16 06:00:05 2001
@@ -724,9 +724,14 @@
EXPECT
Bar=ARRAY(0x...)
########
-printf "%x %x", unpack "U*", sprintf "\x{1234}%s", "\x{5678}"
+# 20010407.008 sprintf removes utf8-ness
+$a = sprintf "\x{1234}";
+printf "%x %d\n", unpack("U*", $a), length($a);
+$a = sprintf "\x{1234}%s", "\x{5678}";
+printf "%x %x %d\n", unpack("U*", $a), length($a);
EXPECT
-1234 5678
+1234 1
+1234 5678 2
########
# keep this last - doesn't seem to work otherwise?
eval "a.b.c.d.e.f;sub"
End of Patch.