This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8.c, .h: Clarify pod and comment
authorKarl Williamson <public@khwilliamson.com>
Sun, 19 Dec 2010 19:24:07 +0000 (12:24 -0700)
committerKarl Williamson <public@khwilliamson.com>
Mon, 20 Dec 2010 03:22:04 +0000 (20:22 -0700)
utf8.c
utf8.h

diff --git a/utf8.c b/utf8.c
index e615d7b..732b06e 100644 (file)
--- a/utf8.c
+++ b/utf8.c
@@ -980,9 +980,10 @@ Perl_bytes_from_utf8(pTHX_ const U8 *s, STRLEN *len, bool *is_utf8)
 /*
 =for apidoc bytes_to_utf8
 
-Converts a string C<s> of length C<len> from the native encoding into UTF-8.
+Converts a string C<s> of length C<len> bytes from the native encoding into
+UTF-8.
 Returns a pointer to the newly-created string, and sets C<len> to
-reflect the new length.
+reflect the new length in bytes.
 
 A NUL character will be written after the end of the string.
 
diff --git a/utf8.h b/utf8.h
index be14a94..405b8b4 100644 (file)
--- a/utf8.h
+++ b/utf8.h
@@ -234,7 +234,7 @@ Perl's extended UTF-8 means we can have start bytes up to FF.
 #define UTF8_ALLOW_CONTINUATION                0x0002
 #define UTF8_ALLOW_NON_CONTINUATION    0x0004
 #define UTF8_ALLOW_FE_FF               0x0008 /* Allow FE or FF start bytes, \
-                                                 yields above 0x7fffFFFF */
+                                                 yields above 0x7fffFFFF = 31 bits */
 #define UTF8_ALLOW_SHORT               0x0010 /* expecting more bytes */
 #define UTF8_ALLOW_SURROGATE           0x0020
 #define UTF8_ALLOW_FFFF                        0x0040 /* Allow UNICODE_ILLEGAL */