summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFather Chrysostomos <sprout@cpan.org>2011-12-23 20:46:00 -0800
committerFather Chrysostomos <sprout@cpan.org>2011-12-24 09:25:21 -0800
commit6389c77752f6ccdaf7373d97ae65079e9f58d270 (patch)
tree8b659aea2835563efd8ead32bbcbfd185c99f318
parent6d5e92cd815e54c7272b7f63bc855bc25943ce9e (diff)
downloadperl-6389c77752f6ccdaf7373d97ae65079e9f58d270.tar.gz
use VERSION needs to enable uni8bit hint
-rw-r--r--feature.h4
-rwxr-xr-xregen/feature.pl4
-rw-r--r--t/lib/feature/implicit9
3 files changed, 17 insertions, 0 deletions
diff --git a/feature.h b/feature.h
index b32ff9328b..2d06450628 100644
--- 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 */
diff --git a/regen/feature.pl b/regen/feature.pl
index d862b7cc3b..cea90fb393 100755
--- a/regen/feature.pl
+++ b/regen/feature.pl
@@ -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
diff --git a/t/lib/feature/implicit b/t/lib/feature/implicit
index 4dd7dcf32a..1efa62bf14 100644
--- a/t/lib/feature/implicit
+++ b/t/lib/feature/implicit
@@ -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