summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2024-06-11 10:01:26 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2024-06-11 10:01:26 (GMT)
commit0d11e8942ee3116357d66880e3dddf92b011324f (patch)
tree2dc09011e2160b59376498d22f69f572a47427b5
parent9bb857724ad5715f03d47423e8121d22b65b9f11 (diff)
parent16c15b6500e3cc62f35fe09243433e9989ba26bc (diff)
downloadtcl-0d11e8942ee3116357d66880e3dddf92b011324f.zip
tcl-0d11e8942ee3116357d66880e3dddf92b011324f.tar.gz
tcl-0d11e8942ee3116357d66880e3dddf92b011324f.tar.bz2
Merge 8.7. Remove "-profile strict" from examples, since it's already the default.
-rw-r--r--doc/chan.n10
-rw-r--r--doc/encoding.n25
2 files changed, 19 insertions, 16 deletions
diff --git a/doc/chan.n b/doc/chan.n
index 2f8b0a4..f89fc73 100644
--- a/doc/chan.n
+++ b/doc/chan.n
@@ -876,7 +876,7 @@ full line.
.CS
% set f [open test_A_195_B.txt r]
file384b6a8
-% chan configure $f -encoding utf-8 -profile strict
+% chan configure $f -encoding utf-8
% catch {chan gets $f} e d
1
% set d
@@ -886,7 +886,7 @@ file384b6a8
-errorinfo {...} -errorline 1
% chan tell $f
0
-% chan configure $f -encoding binary -profile strict
+% chan configure $f -encoding binary
% chan gets $f
AÃB
.CE
@@ -900,7 +900,7 @@ position 1. The data at the error position is thus recovered by the next
.CS
% set f [open test_A_195_B.txt r]
file35a65a0
-% chan configure $f -encoding utf-8 -profile strict -blocking 1
+% chan configure $f -encoding utf-8 -blocking 1
% catch {chan read $f} e d
1
% set d
@@ -910,7 +910,7 @@ file35a65a0
-errorinfo {...} -errorline 1
% chan tell $f
1
-% chan configure $f -encoding binary -profile strict
+% chan configure $f -encoding binary
% chan read $f
ÃB
% chan close $f
@@ -921,7 +921,7 @@ Finally the same example, but this time with a non-blocking channel.
.CS
% set f [open test_A_195_B.txt r]
file35a65a0
-% chan configure $f -encoding utf-8 -profile strict -blocking 0
+% chan configure $f -encoding utf-8 -blocking 0
% chan read $f
A
% chan tell $f
diff --git a/doc/encoding.n b/doc/encoding.n
index 99dd203..c28406f 100644
--- a/doc/encoding.n
+++ b/doc/encoding.n
@@ -30,19 +30,21 @@ Performs one of several encoding related operations, depending on
.\" METHOD: convertfrom
.TP
\fBencoding convertfrom\fR ?\fIencoding\fR? \fIdata\fR
+.VS "TCL8.7 TIP607, TIP656"
.TP
\fBencoding convertfrom\fR ?\fB-profile \fIprofile\fR? ?\fB-failindex var\fR? \fIencoding data\fR
+.VE "TCL8.7 TIP607, TIP656"
.
Converts \fIdata\fR, which should be in binary string encoded as per
\fIencoding\fR, to a Tcl string. If \fIencoding\fR is not specified, the current
system encoding is used.
-
+.PP
.VS "TCL8.7 TIP607, TIP656"
The \fB-profile\fR option determines the command behavior in the presence
of conversion errors. See the \fBPROFILES\fR section below for details. Any premature
termination of processing due to errors is reported through an exception if
the \fB-failindex\fR option is not specified.
-
+.PP
If the \fB-failindex\fR is specified, instead of an exception being raised
on premature termination, the result of the conversion up to the point of the
error is returned as the result of the command. In addition, the index
@@ -60,7 +62,7 @@ Convert \fIstring\fR to the specified \fIencoding\fR. The result is a Tcl binary
string that contains the sequence of bytes representing the converted string in
the specified encoding. If \fIencoding\fR is not specified, the current system
encoding is used.
-
+.PP
.VS "TCL8.7 TIP607, TIP656"
The \fB-profile\fR and \fB-failindex\fR options have the same effect as
described for the \fBencoding convertfrom\fR command.
@@ -89,9 +91,10 @@ The encodings
and
.QW iso8859-1
are guaranteed to be present in the list.
-.VS "TCL8.7 TIP656"
+.\" METHOD: profiles
.TP
\fBencoding profiles\fR
+.VS "TCL8.7 TIP656"
Returns a list of the names of encoding profiles. See \fBPROFILES\fR below.
.VE "TCL8.7 TIP656"
.\" METHOD: system
@@ -200,18 +203,18 @@ The letter \fBA\fR is Unicode character U+0041 and the byte "\ex80" is invalid
in ASCII encoding.
.PP
.CS
-% codepoints [encoding convertfrom -profile tcl8 ascii A\ex80]
+% codepoints [\fBencoding convertfrom\fR -profile tcl8 ascii A\ex80]
U+000041 U+000080
-% codepoints [encoding convertfrom -profile replace ascii A\ex80]
+% codepoints [\fBencoding convertfrom\fR -profile replace ascii A\ex80]
U+000041 U+00FFFD
-% codepoints [encoding convertfrom -profile strict ascii A\ex80]
+% codepoints [\fBencoding convertfrom\fR -profile strict ascii A\ex80]
unexpected byte sequence starting at index 1: '\ex80'
.CE
.PP
Example 3: Get partial data and the error location:
.PP
.CS
-% codepoints [encoding convertfrom -profile strict -failindex idx ascii AB\ex80]
+% codepoints [\fBencoding convertfrom\fR -profile strict -failindex idx ascii AB\ex80]
U+000041 U+000042
% set idx
2
@@ -220,11 +223,11 @@ U+000041 U+000042
Example 4: Encode a character that is not representable in ISO8859-1:
.PP
.CS
-% encoding convertto iso8859-1 A\eu0141
+% \fBencoding convertto\fR iso8859-1 A\eu0141
A?
-% encoding convertto -profile strict iso8859-1 A\eu0141
+% \fBencoding convertto\fR -profile strict iso8859-1 A\eu0141
unexpected character at index 1: 'U+000141'
-% encoding convertto -profile strict -failindex idx iso8859-1 A\eu0141
+% \fBencoding convertto\fR -profile strict -failindex idx iso8859-1 A\eu0141
A
% set idx
1