diff options
author | Rafael Garcia-Suarez <rgs@consttype.org> | 2009-12-20 16:23:36 +0100 |
---|---|---|
committer | Rafael Garcia-Suarez <rgs@consttype.org> | 2009-12-20 16:28:36 +0100 |
commit | 1863b87966ed39b042c45e12d1b4e0b90b9cc071 (patch) | |
tree | eae5c03c697269b036352d4b007f9c1294f189c9 /t | |
parent | 1d5fe431325abdb0f3947d563ebdef67bd4cb7cd (diff) | |
download | perl-1863b87966ed39b042c45e12d1b4e0b90b9cc071.tar.gz |
Introduce C<use feature "unicode_strings">
This turns on the unicode semantics for uc/lc/ucfirst/lcfirst
operations on strings without the UTF8 bit set but with ASCII
characters higher than 127. This replaces the "legacy" pragma
experiment.
Note that currently this feature sets both a bit in $^H and
a (unused) key in %^H. The bit in $^H could be replaced by
a flag on the uc/lc/etc op. It's probably not feasible to
test a key in %^H in pp_uc in friends each time we want to
know which semantics to apply.
Diffstat (limited to 't')
-rw-r--r-- | t/lib/feature/bundle | 19 | ||||
-rw-r--r-- | t/uni/overload.t | 2 |
2 files changed, 20 insertions, 1 deletions
diff --git a/t/lib/feature/bundle b/t/lib/feature/bundle index a869c7541f..11fde323ed 100644 --- a/t/lib/feature/bundle +++ b/t/lib/feature/bundle @@ -7,6 +7,25 @@ say "Hello", "world"; EXPECT Helloworld ######## +# Standard feature bundle, no 5.11 +use feature ":5.10"; +say ord uc chr 233; +EXPECT +233 +######## +# Standard feature bundle, 5.11 +use feature ":5.11"; +say ord uc chr 233; +EXPECT +201 +######## +# Standard feature bundle, 5.11 +use feature ":5.11"; +use utf8; +say ord "\ué"; # this is utf8 +EXPECT +201 +######## # more specific: 5.10.0 maps to 5.10 use feature ":5.10.0"; say "Hello", "world"; diff --git a/t/uni/overload.t b/t/uni/overload.t index da9b07beb7..7bf48414e1 100644 --- a/t/uni/overload.t +++ b/t/uni/overload.t @@ -35,7 +35,7 @@ package main; # These tests are based on characters 128-255 not having latin1, and hence # Unicode, semantics -use legacy 'unicode8bit'; +# no feature "unicode_strings"; # Bug 34297 foreach my $t ("ASCII", "B\366se") { |