Change 14206 by jhi@alpha on 2002/01/12 05:11:20

        Andreas is busy :-)

Affected files ...

.... //depot/perl/doop.c#120 edit
.... //depot/perl/t/op/unisprintf.t#2 edit

Differences ...

==== //depot/perl/doop.c#120 (text) ====
Index: perl/doop.c
--- perl/doop.c.~1~     Fri Jan 11 22:15:05 2002
+++ perl/doop.c Fri Jan 11 22:15:05 2002
@@ -697,6 +697,7 @@
     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);

==== //depot/perl/t/op/unisprintf.t#2 (text) ====
Index: perl/t/op/unisprintf.t
--- perl/t/op/unisprintf.t.~1~  Fri Jan 11 22:15:05 2002
+++ perl/t/op/unisprintf.t      Fri Jan 11 22:15:05 2002
@@ -6,7 +6,7 @@
     require "test.pl";
 }
 
-plan tests => 23;
+plan tests => 25;
 
 $a = "B\x{fc}f";
 $b = "G\x{100}r";
@@ -124,3 +124,16 @@
     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");
+}
End of Patch.

Reply via email to