Change 17353 by jhi@alpha on 2002/06/25 15:18:15

        Unicode s/// buglet found by Gregor Chrupala in perl-unicode. 

Affected files ...

.... //depot/perl/pp_hot.c#281 edit
.... //depot/perl/t/op/subst.t#31 edit

Differences ...

==== //depot/perl/pp_hot.c#281 (text) ====
Index: perl/pp_hot.c
--- perl/pp_hot.c#280~16456~    Tue May  7 15:24:59 2002
+++ perl/pp_hot.c       Tue Jun 25 08:18:15 2002
@@ -2089,6 +2089,8 @@
            SPAGAIN;
        }
        SvTAINT(TARG);
+       if (doutf8)
+           SvUTF8_on(TARG);
        LEAVE_SCOPE(oldsave);
        RETURN;
     }

==== //depot/perl/t/op/subst.t#31 (xtext) ====
Index: perl/t/op/subst.t
--- perl/t/op/subst.t#30~16124~ Tue Apr 23 19:03:08 2002
+++ perl/t/op/subst.t   Tue Jun 25 08:18:15 2002
@@ -7,7 +7,7 @@
 }
 
 require './test.pl';
-plan( tests => 89 );
+plan( tests => 92 );
 
 $x = 'foo';
 $_ = "x";
@@ -372,10 +372,32 @@
     my $l = my $r = $s;
     $l =~ s/[^\w]//g;
     $r =~ s/[^\w\.]//g;
-    is($l, $r, "use utf8");
+    is($l, $r, "use utf8 \\w");
 }
 
 my $pv1 = my $pv2  = "Andreas J. K\303\266nig";
 $pv1 =~ s/A/\x{100}/;
 substr($pv2,0,1) = "\x{100}";
 is($pv1, $pv2);
+
+{   
+    use utf8;
+    $a = 'España';
+    $a =~ s/ñ/ñ/;
+    like($a, qr/ñ/, "use utf8 RHS");
+}
+
+{
+    use utf8;
+    $a = 'España España';
+    $a =~ s/ñ/ñ/;
+    like($a, qr/ñ/, "use utf8 LHS");
+}
+
+{
+    use utf8;
+    $a = 'España';
+    $a =~ s/ñ/ñ/;
+    like($a, qr/ñ/, "use utf8 LHS and RHS");
+}
+
End of Patch.

Reply via email to