my $arg = shift;
+ return chr hex $1 if $arg =~ /^U\+([0-9a-fA-F]+)$/;
+
return $vianame{$arg} if exists $vianame{$arg};
$txt = do "unicore/Name.pl" unless $txt;
functionality, use charnames::vianame().
For the C0 and C1 control characters (U+0000..U+001F, U+0080..U+009F)
-as of Unicode 3.1, there are no official Unicode names but you can
-use instead the ISO 6429 names (LINE FEED, ESCAPE, and so forth).
-In Unicode 3.2 some naming changes will happen since ISO 6429 has been
-updated. Also note that the U+UU80, U+0081, U+0084, and U+0099
-do not have names even in ISO 6429.
+as of Unicode 3.1, there are no official Unicode names but you can use
+instead the ISO 6429 names (LINE FEED, ESCAPE, and so forth). In
+Unicode 3.2 (as of Perl 5.8) some naming changes take place ISO 6429
+has been updated, see L</ALIASES>. Also note that the U+UU80, U+0081,
+U+0084, and U+0099 do not have names even in ISO 6429.
+
+Since the Unicode standard uses "U+HHHH", so can you: "\N{U+263a}"
+is the Unicode smiley face, or "\N{WHITE SMILING FACE}".
=head1 CUSTOM TRANSLATORS
e = s - 1;
goto cont_scan;
}
+ if (e > s + 2 && s[1] == 'U' && s[2] == '+') {
+ /* \N{U+...} */
+ I32 flags = PERL_SCAN_ALLOW_UNDERSCORES |
+ PERL_SCAN_DISALLOW_PREFIX;
+ s += 3;
+ len = e - s;
+ uv = grok_hex(s, &len, &flags, NULL);
+ s = e + 1;
+ goto NUM_ESCAPE_INSERT;
+ }
res = newSVpvn(s + 1, e - s - 1);
res = new_constant( Nullch, 0, "charnames",
res, Nullsv, "\\N{...}" );