This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
use VERSION needs to enable uni8bit hint
authorFather Chrysostomos <sprout@cpan.org>
Sat, 24 Dec 2011 04:46:00 +0000 (20:46 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Sat, 24 Dec 2011 17:25:21 +0000 (09:25 -0800)
feature.h
regen/feature.pl
t/lib/feature/implicit

index b32ff93..2d06450 100644 (file)
--- a/feature.h
+++ b/feature.h
@@ -107,6 +107,10 @@ S_enable_feature_bundle(pTHX_ SV *ver)
                        ? FEATURE_BUNDLE_510 :
                          FEATURE_BUNDLE_DEFAULT
               ) << HINT_FEATURE_SHIFT;
+    /* special case */
+    assert(PL_curcop == &PL_compiling);
+    if (FEATURE_UNICODE_IS_ENABLED) PL_hints |=  HINT_UNI_8_BIT;
+    else                           PL_hints &= ~HINT_UNI_8_BIT;
 }
 #endif /* PERL_IN_OP_C */
 
index d862b7c..cea90fb 100755 (executable)
@@ -300,6 +300,10 @@ for (reverse @HintedBundles[1..$#HintedBundles]) { # skip default
 print $h <<EOJ;
                          FEATURE_BUNDLE_DEFAULT
               ) << HINT_FEATURE_SHIFT;
+    /* special case */
+    assert(PL_curcop == &PL_compiling);
+    if (FEATURE_UNICODE_IS_ENABLED) PL_hints |=  HINT_UNI_8_BIT;
+    else                           PL_hints &= ~HINT_UNI_8_BIT;
 }
 #endif /* PERL_IN_OP_C */
 EOJ
index 4dd7dcf..1efa62b 100644 (file)
@@ -104,3 +104,12 @@ $[ = 1;
 print qw[a b c][2], "\n";
 EXPECT
 b
+########
+# Implicit unicode_string feature
+use v5.14;
+print 'ss' =~ /\xdf/i ? "ok\n" : "nok\n";
+use v5.8.8;
+print 'ss' =~ /\xdf/i ? "ok\n" : "nok\n";
+EXPECT
+ok
+nok