}
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;
}
=head1 ILLEGAL CHARACTERS
-If you ask for a character that does not exist, a warning is given
-and the Unicode I<replacement character> "\x{FFFD}" is returned.
+If you ask by name for a character that does not exist, a warning is
+given and the Unicode I<replacement character> "\x{FFFD}" is returned.
+
+If you ask by code for a character that does not exist, no warning is
+given and C<undef> is returned. (Though if you ask for a code point
+past U+10FFFF you do get a warning.)
=head1 BUGS
$| = 1;
-print "1..42\n";
+print "1..44\n";
use charnames ':full';
print "ok 39\n";
}
-
print "not " unless ord("\N{ZWNJ}") == 0x200C;
print "ok 40\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";