Document and test the C0 and C1.
authorJarkko Hietaniemi <jhi@iki.fi>
Thu, 14 Feb 2002 23:47:43 +0000 (23:47 +0000)
committerJarkko Hietaniemi <jhi@iki.fi>
Thu, 14 Feb 2002 23:47:43 +0000 (23:47 +0000)
p4raw-id: //depot/perl@14699

lib/charnames.pm
lib/charnames.t

index 1297a76..0241534 100644 (file)
@@ -238,6 +238,13 @@ constant used inside double-quoted strings: in other words, you cannot
 use variables inside the C<\N{...}>.  If you want similar run-time
 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.
+
 =head1 CUSTOM TRANSLATORS
 
 The mechanism of translation of C<\N{...}> escapes is general and not
index e12b920..607f4f3 100644 (file)
@@ -8,7 +8,7 @@ BEGIN {
 }
 
 $| = 1;
-print "1..22\n";
+print "1..25\n";
 
 use charnames ':full';
 
@@ -158,3 +158,18 @@ sub to_bytes {
     print "ok 22\n";
 
 }
+
+print "not " unless "\N{HORIZONTAL TABULATION}" eq "\t";
+print "ok 23\n";
+
+print "not " unless "\N{ESCAPE}" eq "\e";
+print "ok 24\n";
+
+print "not " unless "\N{NULL}" eq "\c@";
+print "ok 25\n";
+
+# TODO: when Unicode 3.2 comes along some names will change
+# HORIZONTAL TABULATION -> CHARACTER TABULATION (since ISO 6429
+# has been updated), and some names will have shorter aliases
+# LINEFEED (LF).  Update the tests, and also update the charnames
+# pragma to support the 3.1 names, and the shorter aliases.