diff options
author | Karl Williamson <khw@cpan.org> | 2014-11-24 11:22:00 -0700 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2014-11-24 15:11:52 -0700 |
commit | e71417e415af4699d56467e02c623bdc01a490cd (patch) | |
tree | a7e25d664f71a2b8b5ab56e19f30682a6e0b9b3f /lib | |
parent | 4ed038e9a620a34a71039c10c46e7b759a26891c (diff) | |
download | perl-e71417e415af4699d56467e02c623bdc01a490cd.tar.gz |
charnames: More fix to work on EBCDIC.
This adds a couple of fixes omitted from
27c3afbd6068ac83b49a11df3e33758ef059027e.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/charnames.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/charnames.pm b/lib/charnames.pm index 28e0282788..2efe3d58b2 100644 --- a/lib/charnames.pm +++ b/lib/charnames.pm @@ -49,7 +49,7 @@ sub vianame # can't change it because of backward compatibility. New code can use # string_vianame() instead. my $ord = CORE::hex $1; - return chr $ord if $ord <= 255 || ! ((caller 0)[8] & $bytes::hint_bits); + return pack("U", $ord) if $ord <= 255 || ! ((caller 0)[8] & $bytes::hint_bits); _charnames::carp _charnames::not_legal_use_bytes_msg($arg, chr $ord); return; } @@ -74,7 +74,7 @@ sub string_vianame { if ($arg =~ /^U\+([0-9a-fA-F]+)$/) { my $ord = CORE::hex $1; - return chr $ord if $ord <= 255 || ! ((caller 0)[8] & $bytes::hint_bits); + return pack("U", $ord) if $ord <= 255 || ! ((caller 0)[8] & $bytes::hint_bits); _charnames::carp _charnames::not_legal_use_bytes_msg($arg, chr $ord); return; |