diff options
Diffstat (limited to 'Master/tlpkg/tlperl/lib/constant.pm')
-rw-r--r-- | Master/tlpkg/tlperl/lib/constant.pm | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/Master/tlpkg/tlperl/lib/constant.pm b/Master/tlpkg/tlperl/lib/constant.pm index 22566ce28cf..ef618c43ab2 100644 --- a/Master/tlpkg/tlperl/lib/constant.pm +++ b/Master/tlpkg/tlperl/lib/constant.pm @@ -4,7 +4,7 @@ use strict; use warnings::register; use vars qw($VERSION %declared); -$VERSION = '1.21'; +$VERSION = '1.23'; #======================================================================= @@ -29,6 +29,19 @@ BEGIN { no strict 'refs'; my $const = $] > 5.009002; *_CAN_PCS = sub () {$const}; + + # Before this makes its way into a dev perl release, we have to do + # browser-sniffing, as it were.... + return unless $const; + *{chr 256} = \3; + if (exists ${__PACKAGE__."::"}{"\xc4\x80"}) { + delete ${__PACKAGE__."::"}{"\xc4\x80"}; + *_DOWNGRADE = sub () {1}; + } + else { + delete ${__PACKAGE__."::"}{chr 256}; + *_DOWNGRADE = sub () {0}; + } } #======================================================================= @@ -117,10 +130,12 @@ sub import { if ($multiple || @_ == 1) { my $scalar = $multiple ? $constants->{$name} : $_[0]; - # Work around perl bug #xxxxx: Sub names (actually glob - # names in general) ignore the UTF8 flag. So we have to - # turn it off to get the "right" symbol table entry. - utf8::is_utf8 $name and utf8::encode $name; + if (_DOWNGRADE) { # for 5.10 to 5.14 + # Work around perl bug #31991: Sub names (actually glob + # names in general) ignore the UTF8 flag. So we have to + # turn it off to get the "right" symbol table entry. + utf8::is_utf8 $name and utf8::encode $name; + } # The constant serves to optimise this entire block out on # 5.8 and earlier. |