summaryrefslogtreecommitdiffstats
path: root/doc/Utf.3
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-24 22:29:07 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2020-05-24 22:29:07 (GMT)
commit2b1daf9bb29fdba966f86c054d96d564b7539684 (patch)
treec4b280ca118cf116e1a091789e63044e09ba7df2 /doc/Utf.3
parent017257e0ef3f20643166931986ea36eeee97f049 (diff)
downloadtcl-2b1daf9bb29fdba966f86c054d96d564b7539684.zip
tcl-2b1daf9bb29fdba966f86c054d96d564b7539684.tar.gz
tcl-2b1daf9bb29fdba966f86c054d96d564b7539684.tar.bz2
Put back "string bytelength", not _that_ important for this TIP.
Document that Tcl_UtfCharComplete() can be used now to protect Tcl_UtfNext()
Diffstat (limited to 'doc/Utf.3')
-rw-r--r--doc/Utf.311
1 files changed, 6 insertions, 5 deletions
diff --git a/doc/Utf.3 b/doc/Utf.3
index 4b5b162..6ebf57d 100644
--- a/doc/Utf.3
+++ b/doc/Utf.3
@@ -233,10 +233,10 @@ characters.
.PP
\fBTcl_UtfCharComplete\fR returns 1 if the source UTF-8 string \fIsrc\fR
of \fIlength\fR bytes is long enough to be decoded by
-\fBTcl_UtfToUniChar\fR, or 0 otherwise. This function does not guarantee
-that the UTF-8 string is properly formed. This routine is used by
-procedures that are operating on a byte at a time and need to know if a
-full Unicode character has been seen.
+\fBTcl_UtfToUniChar\fR/\fBTcl_UtfNext\fR, or 0 otherwise. This function
+does not guarantee that the UTF-8 string is properly formed. This routine
+is used by procedures that are operating on a byte at a time and need to
+know if a full Unicode character has been seen.
.PP
\fBTcl_NumUtfChars\fR corresponds to \fBstrlen\fR for UTF-8 strings. It
returns the number of Tcl_UniChars that are represented by the UTF-8 string
@@ -257,7 +257,8 @@ Given \fIsrc\fR, a pointer to some location in a UTF-8 string,
\fBTcl_UtfNext\fR returns a pointer to the next UTF-8 character in the
string. The caller must not ask for the next character after the last
character in the string if the string is not terminated by a null
-character.
+character. \fBTcl_UtfCharComplete\fR can be used in that case to
+make sure enough bytes are available before calling \fBTcl_UtfNext\fR.
.PP
\fBTcl_UtfPrev\fR is used to step backward through but not beyond the
UTF-8 string that begins at \fIstart\fR. If the UTF-8 string is made