Check-in [b763993f23]

Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix for [d92ec5a2d4fd8b92f], "TIP 346 not marked as provisional for Tcl 8.7".
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | bug-d92ec5a2d4fd8b92
Files: files | file ages | folders
SHA3-256: b763993f231a7326f228886dfa904ec84d2f202d59528e9d1866a65af7c09e55
User & Date: pooryorick 2023-02-14 13:37:03
Context
2023-02-28
12:24
TIP 653: limit proposal to synchronous channels. Closed-Leaf check-in: 0cfa70860d user: pooryorick tags: bug-d92ec5a2d4fd8b92
2023-02-14
13:37
Fix for [d92ec5a2d4fd8b92f], "TIP 346 not marked as provisional for Tcl 8.7". check-in: b763993f23 user: pooryorick tags: bug-d92ec5a2d4fd8b92
2023-02-12
23:24
Re-generate index (this fixes the TIP #655 link) check-in: a1214c967f user: jan.nijtmans tags: main, trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to tip/346.md.

30
31
32
33
34
35
36
37
38
39
40



41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
cousins is mapped to a "`?`" in the '**ascii**' target encoding.  This loss of
information is sometimes not desired.

# Proposed Change

This TIP proposes to make this loss conspicuous.

The idea is to introduce a **-strict** option to **encoding convertto**/**encoding convertfrom**,
that would raise an explicit error when non-mappable characters are met. Every
encoder/decoder can decide, depending on this flag, if it tries to convert
invalid (but common) byte sequences to valid characters or not.




This **-strict** option cannot be combined with the already existing
**-nocomplain** option (see also "History" section below).

For channels, there's a new **-strictencoding** option, to be used in `fconfigure`,
which can be set to true (default: false). Setting it to true has the same
effect as the **-strict** option for **encoding convertto**/**encoding convertfrom**.

For the `utf-8`/`utf-16`/`utf-32` encodings, the **-strict** options has an additional effect for
3 different situations it generates an exception for:

* Byte sequence '\\xC0\\x80' is normally accepted by the utf-8 decoder, since it's a
representation of '\\x00'. When using **-strict**, this byte sequence will raise an error.
<pre>
% encoding convertfrom -strict utf-8 \\xC0\\x80
unexpected byte sequence starting at index 0: '\\xC0'
</pre>

* Invalid byte sequences. By default, the utf-8 decoder detects invalid byte







|
|

|
>
>
>











|







30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
cousins is mapped to a "`?`" in the '**ascii**' target encoding.  This loss of
information is sometimes not desired.

# Proposed Change

This TIP proposes to make this loss conspicuous.

A new option, **encoding convertto**/**encoding convertfrom**, **-strict**
raises an explicit error when non-mappable characters are encountered. Every
encoder/decoder can decide, depending on this flag, if it tries to convert
invalid (but common) byte sequences to valid characters or not.  **-strict** is
a provisional option in Tcl 8.7.  The encoder/decoder improvements it
introduces are incorporated into Tcl 9.0, and no explicit option is required to
enable them.

This **-strict** option cannot be combined with the already existing
**-nocomplain** option (see also "History" section below).

For channels, there's a new **-strictencoding** option, to be used in `fconfigure`,
which can be set to true (default: false). Setting it to true has the same
effect as the **-strict** option for **encoding convertto**/**encoding convertfrom**.

For the `utf-8`/`utf-16`/`utf-32` encodings, the **-strict** options has an additional effect for
3 different situations it generates an exception for:

* Byte sequence '\\xC0\\x80' is normally accepted by the utf-8 decoder since it's a
representation of '\\x00'. When using **-strict**, this byte sequence will raise an error.
<pre>
% encoding convertfrom -strict utf-8 \\xC0\\x80
unexpected byte sequence starting at index 0: '\\xC0'
</pre>

* Invalid byte sequences. By default, the utf-8 decoder detects invalid byte