Change 20288 by [EMAIL PROTECTED] on 2003/07/29 08:29:50

        Subject: [perl #22969] fix $hash{utf8bareword}
        From: Rafael Garcia-Suarez <[EMAIL PROTECTED]>
        Date: Tue, 29 Jul 2003 11:09:37 +0200
        Message-Id: <[EMAIL PROTECTED]>

Affected files ...

... //depot/perl/t/op/utfhash.t#5 edit
... //depot/perl/toke.c#480 edit

Differences ...

==== //depot/perl/t/op/utfhash.t#5 (text) ====
Index: perl/t/op/utfhash.t
--- perl/t/op/utfhash.t#4~15757~        Sat Apr  6 07:47:52 2002
+++ perl/t/op/utfhash.t Tue Jul 29 01:29:50 2003
@@ -5,7 +5,7 @@
     @INC = '../lib';
     require './test.pl';
 
-    plan(tests => 91);
+    plan(tests => 97);
 }
 
 use strict;
@@ -169,4 +169,17 @@
     is ($l, $r, "\\w on each, utf8 now bytes");
   }
 
+}
+
+{
+  # See if utf8 barewords work [perl #22969]
+  use utf8;
+  my %hash = (тест => 123);
+  is($hash{тест}, $hash{'тест'});
+  is($hash{тест}, 123);
+  is($hash{'тест'}, 123);
+  %hash = (тест => 123);
+  is($hash{тест}, $hash{'тест'});
+  is($hash{тест}, 123);
+  is($hash{'тест'}, 123);
 }

==== //depot/perl/toke.c#480 (text) ====
Index: perl/toke.c
--- perl/toke.c#479~20200~      Thu Jul 24 06:06:36 2003
+++ perl/toke.c Tue Jul 29 01:29:50 2003
@@ -786,6 +786,8 @@
        }
        PL_nextval[PL_nexttoke].opval = (OP*)newSVOP(OP_CONST,0, 
newSVpv(PL_tokenbuf,0));
        PL_nextval[PL_nexttoke].opval->op_private |= OPpCONST_BARE;
+       if (UTF && !IN_BYTES && is_utf8_string((U8*)PL_tokenbuf, len))
+           SvUTF8_on(((SVOP*)PL_nextval[PL_nexttoke].opval)->op_sv);
        force_next(token);
     }
     return s;
End of Patch.

Reply via email to