From: Jarkko Hietaniemi Date: Sun, 7 Apr 2002 16:29:09 +0000 (+0000) Subject: charnames::viacode() was broken, noticed by Jeffrey. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=11881cb4dea48582155c802c75a6437b36d20355;p=p5sagit%2Fp5-mst-13.2.git charnames::viacode() was broken, noticed by Jeffrey. p4raw-id: //depot/perl@15783 --- diff --git a/lib/charnames.pm b/lib/charnames.pm index 549a8c2..6cf46a5 100644 --- a/lib/charnames.pm +++ b/lib/charnames.pm @@ -199,7 +199,7 @@ sub viacode if ($code > 0x10FFFF) { carp "Unicode characters only allocated up to 0x10FFFF (you asked for $hex)"; - return "\x{FFFD}"; + return; } return $viacode{$hex} if exists $viacode{$hex}; @@ -209,8 +209,7 @@ sub viacode if ($txt =~ m/^$hex\t\t(.+)/m) { return $viacode{$hex} = $1; } else { - carp "Unknown charcode '$hex'"; - return "\x{FFFD}"; + return; } } diff --git a/lib/charnames.t b/lib/charnames.t index 3123127..6a961c6 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -138,7 +138,7 @@ sub to_bytes { print "ok 17\n"; # Unused Hebrew. - print "not " unless charnames::viacode(0x0590) eq chr(0xFFFD); + print "not " if defined charnames::viacode(0x0590); print "ok 18\n"; }