Document TCL 8.7 behaviour of TIP601 and TIP607.

This commit is contained in:
oehhar
2022-10-28 16:10:17 +00:00
parent b0b713c9dc
commit 5ba7f2ce37

View File

@@ -38,20 +38,22 @@ system encoding is used.
.VS "TCL8.7 TIP346, TIP607, TIP601"
.PP
.RS
If the option \fB-nocomplain\fR is given, the command does not fail on
encoding errors. Instead, any not convertable bytes (like incomplete UTF-8
sequences, see example below) are put as byte values into the output stream.
If the option \fB-nocomplain\fR is not given, the command will fail with an
appropriate error message.
The command does not fail on encoding errors. Instead, any not convertable bytes
(like incomplete UTF-8 sequences, see example below) are put as byte values into
the output stream.
.PP
If the option \fB-failindex\fR with a variable name is given, the error reporting
is changed in the following manner:
in case of a conversion error, the position of the input byte causing the error
is returned in the given variable. The return value of the command are the
converted characters until the first error position. No error condition is raised.
converted characters until the first error position.
In case of no error, the value \fI-1\fR is written to the variable. This option
may not be used together with \fB-nocomplain\fR.
.PP
The option \fB-nocomplain\fR has no effect and is available for compatibility with
TCL 9. In TCL 9, the encoding command fails with an error on any encoding issue.
This switch restores the TCL8.7 behaviour.
.PP
The \fB-strict\fR option followes more strict rules in conversion. Currently, only
the sequence \fB\\xC0\\x80\fR in \fButf-8\fR encoding is disallowed. Additional rules
may follow.
@@ -69,12 +71,9 @@ specified, the current system encoding is used.
.VS "TCL8.7 TIP346, TIP607, TIP601"
.PP
.RS
If the option \fB-nocomplain\fR is given, the command does not fail on
encoding errors. Instead, the replacement character \fB?\fR is output
for any not representable character (like the dot \fB\\U2022\fR
in \fBiso-8859-1\fI encoding, see example below).
If the option \fB-nocomplain\fR is not given, the command will fail with an
appropriate error message.
The command does not fail on encoding errors. Instead, the replacement character
\fB?\fR is output for any not representable character (like the dot \fB\\U2022\fR
in \fBiso-8859-1\fR encoding, see example below).
.PP
If the option \fB-failindex\fR with a variable name is given, the error reporting
is changed in the following manner:
@@ -84,6 +83,10 @@ converted bytes until the first error position. No error condition is raised.
In case of no error, the value \fI-1\fR is written to the variable. This option
may not be used together with \fB-nocomplain\fR.
.PP
The option \fB-nocomplain\fR has no effect and is available for compatibility with
TCL 9. In TCL 9, the encoding command fails with an error on any encoding issue.
This switch restores the TCL8.7 behaviour.
.PP
The \fB-strict\fR option followes more strict rules in conversion. Currently, it has
no effect but may be used in future to add additional encoding checks.
.VE "TCL8.7 TIP346, TIP607, TIP601"
@@ -143,7 +146,8 @@ Example 3: return the incomplete UTF-8 sequence by raw bytes:
.CS
% set s [\fBencoding convertfrom\fR -nocomplain utf-8 "A\exC3"]
.CE
The result is "A" followed by the byte \exC3.
The result is "A" followed by the byte \exC3. The option \fB-nocomplain\fR
has no effect, but assures to get the same result with TCL9.
.PP
Example 4: detect the error location while transforming to ISO8859-1
(ISO-Latin 1):
@@ -161,6 +165,8 @@ Example 5: replace a not representable character by the replacement character:
% set s [\fBencoding convertto\fR -nocomplain utf-8 "A\eu0141"]
A?
.CE
The option \fB-nocomplain\fR has no effect, but assures to get the same result
with TCL9.
.VE "TCL8.7 TIP346, TIP607, TIP601"
.PP
.SH "SEE ALSO"