From: Jarkko Hietaniemi Date: Tue, 28 May 2002 13:32:46 +0000 (+0000) Subject: More charnames tweaks. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=00d835f2e04ba49347fca7d3b138f4c76991dcc3;p=p5sagit%2Fp5-mst-13.2.git More charnames tweaks. p4raw-id: //depot/perl@16835 --- diff --git a/lib/charnames.pm b/lib/charnames.pm index d826cb3..a540d14 100644 --- a/lib/charnames.pm +++ b/lib/charnames.pm @@ -203,7 +203,7 @@ sub viacode } if ($code > 0x10FFFF) { - carp "Unicode characters only allocated up to 0x10FFFF (you asked for $hex)"; + carp sprintf "Unicode characters only allocated up to U+10FFFF (you asked for U+%X)", $hex; return; } @@ -415,8 +415,12 @@ will also give a warning about being deprecated. =head1 ILLEGAL CHARACTERS -If you ask for a character that does not exist, a warning is given -and the Unicode I "\x{FFFD}" is returned. +If you ask by name for a character that does not exist, a warning is +given and the Unicode I "\x{FFFD}" is returned. + +If you ask by code for a character that does not exist, no warning is +given and C is returned. (Though if you ask for a code point +past U+10FFFF you do get a warning.) =head1 BUGS diff --git a/lib/charnames.t b/lib/charnames.t index 669f6e8..218cd9a 100644 --- a/lib/charnames.t +++ b/lib/charnames.t @@ -12,7 +12,7 @@ BEGIN { $| = 1; -print "1..42\n"; +print "1..44\n"; use charnames ':full'; @@ -226,7 +226,6 @@ print "ok 38\n"; print "ok 39\n"; } - print "not " unless ord("\N{ZWNJ}") == 0x200C; print "ok 40\n"; @@ -236,3 +235,8 @@ print "ok 41\n"; print "not " unless "\N{U+263A}" eq "\N{WHITE SMILING FACE}"; print "ok 42\n"; +print "not " if defined charnames::viacode(0x110000); +print "ok 43\n"; + +print "not " if grep { /you asked for U+110000/ } @WARN; +print "ok 44\n";