diff options
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; |