summaryrefslogtreecommitdiff
path: root/utf8.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2000-12-07 19:05:32 +0000
committerJarkko Hietaniemi <jhi@iki.fi>2000-12-07 19:05:32 +0000
commit4dffa63e352fd05b59c46f19323b72952b04b8ce (patch)
tree8dd86a39ce9832c8b1c2ca42ed074c2ff4ec7aaf /utf8.c
parentb06226ff370ef661c3ff28e6f65e1ba0ef078609 (diff)
downloadperl-4dffa63e352fd05b59c46f19323b72952b04b8ce.tar.gz
Document utf8_to_uv() better.
p4raw-id: //depot/perl@8024
Diffstat (limited to 'utf8.c')
-rw-r--r--utf8.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/utf8.c b/utf8.c
index 244bb639bb..9ef7ce108b 100644
--- a/utf8.c
+++ b/utf8.c
@@ -189,9 +189,11 @@ and the pointer C<s> will be advanced to the end of the character.
If C<s> does not point to a well-formed UTF8 character, the behaviour
is dependent on the value of C<flags>: if it contains UTF8_CHECK_ONLY,
it is assumed that the caller will raise a warning, and this function
-will set C<retlen> to C<-1> and return. The C<flags> can also contain
-various flags to allow deviations from the strict UTF-8 encoding
-(see F<utf8.h>).
+will set C<retlen> to C<-1> and return zero. If the C<flags> does not
+contain UTF8_CHECK_ONLY, the UNICODE_REPLACEMENT_CHARACTER (0xFFFD)
+will be returned, and C<retlen> will be set to the expected length of
+the UTF-8 character in bytes. The C<flags> can also contain various
+flags to allow deviations from the strict UTF-8 encoding (see F<utf8.h>).
=cut */
@@ -336,7 +338,7 @@ malformed:
}
if (retlen)
- *retlen = expectlen ? expectlen : len;
+ *retlen = expectlen;
return UNICODE_REPLACEMENT_CHARACTER;
}