summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-03-17 09:51:38 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-03-17 09:51:38 (GMT)
commitcf4140cc14a1800d2a74e73545fd86c49f3a1e73 (patch)
treee90b82a0260d5ead97aeff9dc4e483bccb3f92de /doc
parent2041f4450bf1aca29472f00ab21b13448bcde2d4 (diff)
parent6ec7e10a1634a0a9c10ed2cf90072ba723d701ce (diff)
downloadtcl-cf4140cc14a1800d2a74e73545fd86c49f3a1e73.zip
tcl-cf4140cc14a1800d2a74e73545fd86c49f3a1e73.tar.gz
tcl-cf4140cc14a1800d2a74e73545fd86c49f3a1e73.tar.bz2
TIP #601: Make "encoding convertto/convertfrom" throw exceptions
Diffstat (limited to 'doc')
-rw-r--r--doc/Encoding.321
1 files changed, 20 insertions, 1 deletions
diff --git a/doc/Encoding.3 b/doc/Encoding.3
index c68070c..dc37519 100644
--- a/doc/Encoding.3
+++ b/doc/Encoding.3
@@ -25,9 +25,15 @@ int
char *
\fBTcl_ExternalToUtfDString\fR(\fIencoding, src, srcLen, dstPtr\fR)
.sp
+size_t
+\fBTcl_ExternalToUtfDStringEx\fR(\fIencoding, src, srcLen, flags, dstPtr\fR)
+.sp
char *
\fBTcl_UtfToExternalDString\fR(\fIencoding, src, srcLen, dstPtr\fR)
.sp
+size_t
+\fBTcl_UtfToExternalDStringEx\fR(\fIencoding, src, srcLen, flags, dstPtr\fR)
+.sp
int
\fBTcl_ExternalToUtf\fR(\fIinterp, encoding, src, srcLen, flags, statePtr,
dst, dstLen, srcReadPtr, dstWrotePtr, dstCharsPtr\fR)
@@ -108,7 +114,10 @@ byte is converted and then to reset to an initial state.
\fBTCL_ENCODING_STOPONERROR\fR signifies that the conversion routine should
return immediately upon reading a source character that does not exist in
the target encoding; otherwise a default fallback character will
-automatically be substituted.
+automatically be substituted. The flag \fBTCL_ENCODING_NOCOMPLAIN\fR has
+no effect, it is reserved for Tcl 9.0. The flag \fBTCL_ENCODING_MODIFIED\fR makes
+\fBTcl_UtfToExternalDStringEx\fR and \fBTcl_UtfToExternal\fR produce the
+byte sequence \exC0\ex80 in stead of \ex00, for the utf-8/cesu-8 encoders.
.AP Tcl_EncodingState *statePtr in/out
Used when converting a (generally long or indefinite length) byte stream
in a piece-by-piece fashion. The conversion routine stores its current
@@ -208,6 +217,11 @@ When converting, if any of the characters in the source buffer cannot be
represented in the target encoding, a default fallback character will be
used. The return value is a pointer to the value stored in the DString.
.PP
+\fBTcl_ExternalToUtfDStringEx\fR is the same as \fBTcl_ExternalToUtfDString\fR,
+but it has an additional flags parameter. The return value is the index of
+the first byte in the input string causing a conversion error.
+Or (size_t)-1 if all is OK.
+.PP
\fBTcl_ExternalToUtf\fR converts a source buffer \fIsrc\fR from the specified
\fIencoding\fR into UTF-8. Up to \fIsrcLen\fR bytes are converted from the
source buffer and up to \fIdstLen\fR converted bytes are stored in \fIdst\fR.
@@ -246,6 +260,11 @@ characters in the source buffer cannot be represented in the target
encoding, a default fallback character will be used. The return value is
a pointer to the value stored in the DString.
.PP
+\fBTcl_UtfToExternalDStringEx\fR is the same as \fBTcl_UtfToExternalDString\fR,
+but it has an additional flags parameter. The return value is the index of
+the first byte of an utf-8 byte-sequence in the input string causing a
+conversion error. Or (size_t)-1 if all is OK.
+.PP
\fBTcl_UtfToExternal\fR converts a source buffer \fIsrc\fR from UTF-8 into
the specified \fIencoding\fR. Up to \fIsrcLen\fR bytes are converted from
the source buffer and up to \fIdstLen\fR converted bytes are stored in