Check-in [b2f25446c3]

Login
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

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

Overview
Comment:Formatting
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b2f25446c36fabfd518e2c3d3b787ce42799ef1720fc9b945599c07bf9bf7ae0
User & Date: jan.nijtmans 2019-06-14 14:45:19
Context
2019-06-15
07:48
Update TIP with experience of implementing it check-in: eb537ee186 user: dkf tags: trunk
2019-06-14
14:45
Formatting check-in: b2f25446c3 user: jan.nijtmans tags: trunk
2019-06-12
02:05
Clean up some awkward language; thanks to AK for spotting. check-in: 92a144c351 user: dkf tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to index.json.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
...
548
549
550
551
552
553
554
555
{"tip": {
	"550":{"url":"./tip/550.md","keywords":"Tcl, memory","created":"11-Jun-2019","post-history":"","state":"Draft","tcl-version":"9.0","vote":"Pending","type":"Project","title":"# TIP 550: Garbage Collection for TclOO","author":["Donal K. Fellows <[email protected]>"],"is-jest":false},
	"549":{"url":"./tip/549.md","keywords":"Tcl","created":"7-June-2019","post-history":"","state":"Draft","tcl-branch":"tip-549","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 549: Make configure --enable-64bit the default","discussions-to":"Tcl Core list","author":["Jan Nijtmans <[email protected]>","Jan Nijtmans <[email protected]>"],"is-jest":false},
	"548":{"url":"./tip/548.md","keywords":"Tcl","created":"3-June-2019","post-history":"","state":"Draft","tcl-branch":"tip-548","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 548:Deprecate Tcl\\_WinUtfToTChar() and Tcl\\_WinTCharToUtf() and provide more flexible replacement functions.","discussions-to":"Tcl Core list","author":["Jan Nijtmans <[email protected]>","Jan Nijtmans <[email protected]>"],"is-jest":false},
	"547":{"url":"./tip/547.md","keywords":"Tcl","created":"31-May-2019","post-history":"","state":"Draft","tcl-branch":"tip-547","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 547: New encodings: UTF-16, UCS-2.","discussions-to":"Tcl Core list","author":["Jan Nijtmans <[email protected]>","Jan Nijtmans <[email protected]>"],"is-jest":false},
	"546":{"url":"./tip/546.md","keywords":"Tcl, traces","created":"20-May-2019","post-history":"","state":"Draft","vote":"Pending","tcl-version":"8.7","type":"Project","title":"# TIP 546: Typedefs to Support Source-Compatible Migration","author":["Don Porter <[email protected]>"],"is-jest":false},
	"545":{"url":"./tip/545.md","keywords":"Tk, image","created":"19-May-2019","state":"Draft","tk-branch":"tip-545-svg-options","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 545: image photo SVG options: remove -unit and add target height/width option","author":["Harald Oehlmann <[email protected]>"],"is-jest":false},
	"544":{"url":"./tip/544.md","keywords":"Tcl","created":"15-May-2019","post-history":"","state":"Final","tcl-branch":"tip-544","vote":"Done","tcl-version":"8.7","type":"Project","title":"# TIP 544: Export TclGetIntForIndex()","discussions-to":"Tcl Core list","author":["Jan Nijtmans <[email protected]>","François Vogel <[email protected]>"],"is-jest":false},
	"543":{"url":"./tip/543.md","keywords":"Tcl, traces","created":"10-May-2019","post-history":"","state":"Draft","vote":"Pending","tcl-version":"9.0","type":"Project","title":"# TIP 543: Eliminate TCL\\_INTERP\\_DESTROYED flag value","author":["Don Porter <[email protected]>"],"is-jest":false},
	"542":{"url":"./tip/542.md","keywords":"Tcl","created":"10-May-2019","post-history":"","state":"Draft","tcl-branch":"utf-max","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 542:Support for switchable (Androwish-compatible) Full Unicode support.","discussions-to":"Tcl Core list","author":["Jan Nijtmans <[email protected]>","Jan Nijtmans <[email protected]>"],"is-jest":false},
	"541":{"url":"./tip/541.md","keywords":"Tcl","created":"8-May-2019","post-history":"","state":"Final","tcl-branch":"bug-2858503fff","tcl-version":"8.6","vote":"Done","type":"Project","title":"# TIP 541: Add support for 'end' index in ttk::combobox current","author":["Francois Vogel <[email protected]>"],"is-jest":false},
	"540":{"url":"./tip/540.md","keywords":"Tcl, Unix, pipeline","created":"03-May-2019","post-history":"","state":"Draft","vote":"Pending","tcl-version":"8.7","type":"Project","title":"# TIP 540: Add -signal Channel Configure Option to POSIX Pipes","author":["Donal K. Fellows <[email protected]>"],"is-jest":false},
	"539":{"url":"./tip/539.md","tcl-ticket":"2370575","keywords":"Tcl, dict filter, set intersection","created":"27-Nov-2008","obsoleted-by":"341","post-history":"","state":"Withdrawn","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 539: Multiple dict filter patterns","author":["Lars Hellström <[email protected]>"],"is-jest":false},
	"538":{"url":"./tip/538.md","keywords":"Tcl","created":"9-April-2019","post-history":"","state":"Draft","tcl-branch":"digit-bit-60","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 538: Externalize libtommath","author":["Jan Nijtmans <[email protected]>"],"is-jest":false},
	"537":{"url":"./tip/537.md","keywords":"Tcl","created":"7-April-2019","post-history":"","state":"Final","tcl-branch":"regexp-api-64bit","tcl-version":"9.0","vote":"Done","type":"Project","title":"# TIP 537: Enable 64-bit indexes in regexp matching","author":["Jan Nijtmans <[email protected]>"],"is-jest":false},
	"536":{"url":"./tip/536.md","keywords":"Tk","created":"29-March-2019","post-history":"","state":"Draft","tk-branch":"mac_services","tcl-version":"8.6","vote":"In progress","type":"Project","title":"# TIP 536: Improvements to Mac-specific IPC in Tk","author":["Kevin Walzer <[email protected]>"],"is-jest":false},
................................................................................
	"4":{"url":"./tip/4.md","created":"26-Oct-2000","post-history":"","state":"Draft","vote":"Pending","type":"Informative","title":"# TIP 4: Tcl Release and Distribution Philosophy","discussions-to":"news:comp.lang.tcl","author":["Brent Welch <[email protected]>","Donal K. Fellows <[email protected]>","Larry W. Virden <[email protected]>","Larry W. Virden <[email protected]>"],"is-jest":false},
	"3":{"url":"./tip/3.md","created":"14-Sep-2000","obsoleted-by":"467","post-history":"","state":"Accepted","vote":"Done","type":"Process","title":"# TIP 3: TIP Format","author":["Andreas Kupries <[email protected]>","Donal K. Fellows <[email protected]>"],"is-jest":false},
	"2":{"url":"./tip/2.md","created":"12-Sep-2000","post-history":"","state":"Draft","vote":"Pending","type":"Process","title":"# TIP 2: TIP Guidelines","author":["Andreas Kupries <[email protected]>","Donal K. Fellows <[email protected]>","Don Porter <[email protected]>","Mo DeJong <[email protected]>","Larry W. Virden <[email protected]>","Kevin Kenny <[email protected]>"],"is-jest":false},
	"1":{"url":"./tip/1.md","created":"14-Sep-2000","obsoleted-by":"386","post-history":"","state":"Withdrawn","vote":"No voting","type":"Informational","title":"# TIP 1: TIP Index","author":["TIP Editor <[email protected]>"],"is-jest":false},
	"0":{"url":"./tip/0.md","created":"11-Dec-2000","post-history":"","state":"Final","vote":"Done","type":"Process","title":"# TIP 0: Tcl Core Team Basic Rules","author":["John Ousterhout <[email protected]>"],"is-jest":false},
	"@min": 0,
	"@max": 550
}, "@timestamp": 1560278870}


|




|







 







|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
...
548
549
550
551
552
553
554
555
{"tip": {
	"550":{"url":"./tip/550.md","keywords":"Tcl, memory","created":"11-Jun-2019","post-history":"","state":"Draft","tcl-version":"9.0","vote":"Pending","type":"Project","title":"# TIP 550: Garbage Collection for TclOO","author":["Donal K. Fellows <[email protected]>"],"is-jest":false},
	"549":{"url":"./tip/549.md","keywords":"Tcl","created":"7-June-2019","post-history":"","state":"Draft","tcl-branch":"tip-549","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 549: Make configure --enable-64bit the default","discussions-to":"Tcl Core list","author":["Jan Nijtmans <[email protected]>","Jan Nijtmans <[email protected]>"],"is-jest":false},
	"548":{"url":"./tip/548.md","keywords":"Tcl","created":"3-June-2019","post-history":"","state":"Draft","tcl-branch":"tip-548","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 548:Deprecate `Tcl_WinUtfToTChar()` and `Tcl_WinTCharToUtf()` and provide more flexible replacement functions.","discussions-to":"Tcl Core list","author":["Jan Nijtmans <[email protected]>","Jan Nijtmans <[email protected]>"],"is-jest":false},
	"547":{"url":"./tip/547.md","keywords":"Tcl","created":"31-May-2019","post-history":"","state":"Draft","tcl-branch":"tip-547","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 547: New encodings: UTF-16, UCS-2.","discussions-to":"Tcl Core list","author":["Jan Nijtmans <[email protected]>","Jan Nijtmans <[email protected]>"],"is-jest":false},
	"546":{"url":"./tip/546.md","keywords":"Tcl, traces","created":"20-May-2019","post-history":"","state":"Draft","vote":"Pending","tcl-version":"8.7","type":"Project","title":"# TIP 546: Typedefs to Support Source-Compatible Migration","author":["Don Porter <[email protected]>"],"is-jest":false},
	"545":{"url":"./tip/545.md","keywords":"Tk, image","created":"19-May-2019","state":"Draft","tk-branch":"tip-545-svg-options","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 545: image photo SVG options: remove -unit and add target height/width option","author":["Harald Oehlmann <[email protected]>"],"is-jest":false},
	"544":{"url":"./tip/544.md","keywords":"Tcl","created":"15-May-2019","post-history":"","state":"Final","tcl-branch":"tip-544","vote":"Done","tcl-version":"8.7","type":"Project","title":"# TIP 544: Export TclGetIntForIndex()","discussions-to":"Tcl Core list","author":["Jan Nijtmans <[email protected]>","François Vogel <[email protected]>"],"is-jest":false},
	"543":{"url":"./tip/543.md","keywords":"Tcl, traces","created":"10-May-2019","post-history":"","state":"Draft","vote":"Pending","tcl-version":"9.0","type":"Project","title":"# TIP 543: Eliminate `TCL_INTERP_DESTROYED` flag value","author":["Don Porter <[email protected]>"],"is-jest":false},
	"542":{"url":"./tip/542.md","keywords":"Tcl","created":"10-May-2019","post-history":"","state":"Draft","tcl-branch":"utf-max","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 542:Support for switchable (Androwish-compatible) Full Unicode support.","discussions-to":"Tcl Core list","author":["Jan Nijtmans <[email protected]>","Jan Nijtmans <[email protected]>"],"is-jest":false},
	"541":{"url":"./tip/541.md","keywords":"Tcl","created":"8-May-2019","post-history":"","state":"Final","tcl-branch":"bug-2858503fff","tcl-version":"8.6","vote":"Done","type":"Project","title":"# TIP 541: Add support for 'end' index in ttk::combobox current","author":["Francois Vogel <[email protected]>"],"is-jest":false},
	"540":{"url":"./tip/540.md","keywords":"Tcl, Unix, pipeline","created":"03-May-2019","post-history":"","state":"Draft","vote":"Pending","tcl-version":"8.7","type":"Project","title":"# TIP 540: Add -signal Channel Configure Option to POSIX Pipes","author":["Donal K. Fellows <[email protected]>"],"is-jest":false},
	"539":{"url":"./tip/539.md","tcl-ticket":"2370575","keywords":"Tcl, dict filter, set intersection","created":"27-Nov-2008","obsoleted-by":"341","post-history":"","state":"Withdrawn","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 539: Multiple dict filter patterns","author":["Lars Hellström <[email protected]>"],"is-jest":false},
	"538":{"url":"./tip/538.md","keywords":"Tcl","created":"9-April-2019","post-history":"","state":"Draft","tcl-branch":"digit-bit-60","tcl-version":"8.7","vote":"Pending","type":"Project","title":"# TIP 538: Externalize libtommath","author":["Jan Nijtmans <[email protected]>"],"is-jest":false},
	"537":{"url":"./tip/537.md","keywords":"Tcl","created":"7-April-2019","post-history":"","state":"Final","tcl-branch":"regexp-api-64bit","tcl-version":"9.0","vote":"Done","type":"Project","title":"# TIP 537: Enable 64-bit indexes in regexp matching","author":["Jan Nijtmans <[email protected]>"],"is-jest":false},
	"536":{"url":"./tip/536.md","keywords":"Tk","created":"29-March-2019","post-history":"","state":"Draft","tk-branch":"mac_services","tcl-version":"8.6","vote":"In progress","type":"Project","title":"# TIP 536: Improvements to Mac-specific IPC in Tk","author":["Kevin Walzer <[email protected]>"],"is-jest":false},
................................................................................
	"4":{"url":"./tip/4.md","created":"26-Oct-2000","post-history":"","state":"Draft","vote":"Pending","type":"Informative","title":"# TIP 4: Tcl Release and Distribution Philosophy","discussions-to":"news:comp.lang.tcl","author":["Brent Welch <[email protected]>","Donal K. Fellows <[email protected]>","Larry W. Virden <[email protected]>","Larry W. Virden <[email protected]>"],"is-jest":false},
	"3":{"url":"./tip/3.md","created":"14-Sep-2000","obsoleted-by":"467","post-history":"","state":"Accepted","vote":"Done","type":"Process","title":"# TIP 3: TIP Format","author":["Andreas Kupries <[email protected]>","Donal K. Fellows <[email protected]>"],"is-jest":false},
	"2":{"url":"./tip/2.md","created":"12-Sep-2000","post-history":"","state":"Draft","vote":"Pending","type":"Process","title":"# TIP 2: TIP Guidelines","author":["Andreas Kupries <[email protected]>","Donal K. Fellows <[email protected]>","Don Porter <[email protected]>","Mo DeJong <[email protected]>","Larry W. Virden <[email protected]>","Kevin Kenny <[email protected]>"],"is-jest":false},
	"1":{"url":"./tip/1.md","created":"14-Sep-2000","obsoleted-by":"386","post-history":"","state":"Withdrawn","vote":"No voting","type":"Informational","title":"# TIP 1: TIP Index","author":["TIP Editor <[email protected]>"],"is-jest":false},
	"0":{"url":"./tip/0.md","created":"11-Dec-2000","post-history":"","state":"Final","vote":"Done","type":"Process","title":"# TIP 0: Tcl Core Team Basic Rules","author":["John Ousterhout <[email protected]>"],"is-jest":false},
	"@min": 0,
	"@max": 550
}, "@timestamp": 1560523479}

Changes to index.md.

230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
...
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<td valign='top'><a href='/tcl/timeline?r=tip-549'>Link</a></td>
</tr>
<tr class='state-draft type-project version-87'>
<td valign='top'><a href='./tip/548.md'>548</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
<td valign='top' ><a href='./tip/548.md'>Deprecate Tcl\_WinUtfToTChar() and Tcl\_WinTCharToUtf() and provide more flexible replacement functions.</a></td>
<td valign='top'><a href='/tcl/timeline?r=tip-548'>Link</a></td>
</tr>
<tr class='state-draft type-project version-87'>
<td valign='top'><a href='./tip/547.md'>547</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
................................................................................
<td valign='top'><a href='/tcl/timeline?r=tip-544'>Link</a></td>
</tr>
<tr class='state-draft type-project version-90'>
<td valign='top'><a href='./tip/543.md'>543</a></td>
<td valign='top'>Project</td>
<td valign='top'>9.0</td>
<td valign='top'>Draft</td>
<td valign='top' ><a href='./tip/543.md'>Eliminate TCL\_INTERP\_DESTROYED flag value</a></td>
<td></td>
</tr>
<tr class='state-draft type-project version-87'>
<td valign='top'><a href='./tip/542.md'>542</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>






|







 







|







230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
...
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
<td valign='top'><a href='/tcl/timeline?r=tip-549'>Link</a></td>
</tr>
<tr class='state-draft type-project version-87'>
<td valign='top'><a href='./tip/548.md'>548</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
<td valign='top' ><a href='./tip/548.md'>Deprecate `Tcl_WinUtfToTChar()` and `Tcl_WinTCharToUtf()` and provide more flexible replacement functions.</a></td>
<td valign='top'><a href='/tcl/timeline?r=tip-548'>Link</a></td>
</tr>
<tr class='state-draft type-project version-87'>
<td valign='top'><a href='./tip/547.md'>547</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>
................................................................................
<td valign='top'><a href='/tcl/timeline?r=tip-544'>Link</a></td>
</tr>
<tr class='state-draft type-project version-90'>
<td valign='top'><a href='./tip/543.md'>543</a></td>
<td valign='top'>Project</td>
<td valign='top'>9.0</td>
<td valign='top'>Draft</td>
<td valign='top' ><a href='./tip/543.md'>Eliminate `TCL_INTERP_DESTROYED` flag value</a></td>
<td></td>
</tr>
<tr class='state-draft type-project version-87'>
<td valign='top'><a href='./tip/542.md'>542</a></td>
<td valign='top'>Project</td>
<td valign='top'>8.7</td>
<td valign='top'>Draft</td>

Changes to tip/542.md.

12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
	Tcl-Branch:     utf-max
-----

# Abstract

This TIP proposes being able to switch Tcl between Full Unicode mode
(TCL\_UTF\_MAX>3, almost compatible with Androwish) and current partial
Unicode mode (as far as TIP #389 goes, using TCL\_UTF\_MAX=3) 

# Rationale

Tcl currently can be compiled in 3 different modes: using TCL\_UTF\_MAX=3, TCL\_UTF\_MAX=4
or TCL\_UTF\_MAX=6. The first 2 are actually equal now in Tcl 8.7 (since TIP #389). Using
TCL\_UTF\_MAX=6 is actually overkill, since no utf-8 character consists of more than 4 bytes.







|







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
	Tcl-Branch:     utf-max
-----

# Abstract

This TIP proposes being able to switch Tcl between Full Unicode mode
(TCL\_UTF\_MAX>3, almost compatible with Androwish) and current partial
Unicode mode (as far as TIP #389 goes, using `TCL_UTF_MAX=3`) 

# Rationale

Tcl currently can be compiled in 3 different modes: using TCL\_UTF\_MAX=3, TCL\_UTF\_MAX=4
or TCL\_UTF\_MAX=6. The first 2 are actually equal now in Tcl 8.7 (since TIP #389). Using
TCL\_UTF\_MAX=6 is actually overkill, since no utf-8 character consists of more than 4 bytes.

Changes to tip/543.md.

1
2
3
4
5
6
7
8
# TIP 543: Eliminate TCL\_INTERP\_DESTROYED flag value
	Author:         Don Porter <[email protected]>
	State:          Draft
	Type:           Project
	Tcl-Version:    9.0
	Vote:           Pending
	Created:        10-May-2019
	Keywords:       Tcl, traces
|







1
2
3
4
5
6
7
8
# TIP 543: Eliminate `TCL_INTERP_DESTROYED` flag value
	Author:         Don Porter <[email protected]>
	State:          Draft
	Type:           Project
	Tcl-Version:    9.0
	Vote:           Pending
	Created:        10-May-2019
	Keywords:       Tcl, traces

Changes to tip/548.md.

1
2
3
4
5
6
7
8
..
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# TIP 548:Deprecate Tcl\_WinUtfToTChar() and Tcl\_WinTCharToUtf() and provide more flexible replacement functions.
	Author:         Jan Nijtmans <[email protected]>
	Author:         Jan Nijtmans <[email protected]>
	State:          Draft
	Type:           Project
	Vote:           Pending
	Created:        3-June-2019
	Post-History:   
................................................................................
	Keywords:       Tcl
	Tcl-Version:    8.7
	Tcl-Branch:     tip-548
-----

# Abstract

This TIP proposes to deprecate Tcl\_WinUtfToTChar() and Tcl\_WinTCharToUtf() and provide more flexible replacement functions.

# Rationale

The functions Tcl\_WinUtfToTChar() and Tcl\_WinTCharToUtf() originally were functions able to do two different conversions,
depending on the runtime platform: On Windows 95/98/ME they performed conversions between Utf-8 and the Windows default encoding
(usually cp1252), on later Windows versions they convert between Utf-8 and Utf-16. The length parameter of Tcl\_WinTCharToUtf()
always was in bytes, but most other Unicode-related Tcl functions expect their length in Unicode characters.

Since Windows 95/98/ME are not supported any more, it's time to fix this inconsistency.

# Specification

This document proposes:

 * Deprecate the following functions:

     Tcl\_WinUtfToTChar()

     Tcl\_WinTCharToUtf()

   If Tcl is compiled with either -DTCL\_UTF\_MAX=6 (which is not officially supported) or -DTCL\_NO\_DEPRECATED, those functions will
   no longer be available. In Tcl 9.0, those functions will be completely removed.

 * Enhance the Tcl\_UniCharToUtfDString() function such that the uniLength parameter is allowed to
   have the value -1. In that case, the UniChar string will be read up to the closing /u0000 character.

 * New replacement functions:

     Tcl\_UtfToUtf16DString(), replaces Tcl\_WinUtfToTChar()

     Tcl\_Utf16ToUtfDString(), replaces Tcl\_WinTCharToUtf()

     Those are the same as the already existing _UniChar_ variants (Tcl\_UniCharToUtfDString/Tcl\_UtfToUniCharDString), but they use an "unsigned short"
     pointer type in their signature stead of a "Tcl\_UniChar" pointer type, which is always 16-bits.
     Tcl\_Utf16ToUtfDString() accepts - just as Tcl\_UniCharToUtfDString() - the value -1 as length parameter.

     Those functions can be used if you want your extension to compile with -DTCL\_UTF\_MAX=3, -DTCL\_UTF\_MAX=4 or -DTCL\_UTF\_MAX=6,
     but still want to use the 16-bit conversions independent on the TCL\_UTF\_MAX setting or Tcl\_UniChar type.

     Those functions are available on all platforms, not only Windows.

# How to upgrade.

In your extension, replace the call:

     Tcl_WinUtfToTChar(....., bufPtr);
     
with the following two lines:

     Tcl_DStringInit(bufPtr);
     Tcl_UtfToUtf16DString(....., bufPtr);

And also, replace:

     Tcl_WinTCharToUtf(....., bufPtr);
     
with the following two lines:

     Tcl_DStringInit(bufPtr);
     Tcl_Utf16ToUtfDString(....., bufPtr);

If the Tcl\_WinTCharToUtf() call originally had a "length" parameter not equal to -1, divide it by 2 (or ... don't multiply it by 2 any more).


# Compatibility

This is fully upwards compatible in Tcl 8.x, except if Tcl is compiled with -DTCL\_UTF\_MAX=6 (not officially supported) or
-DTCL\_NO\_DEPRECATED. Starting with Tcl 9.0, the replacement functions should be used in stead.

# Reference Implementation

A reference implementation is available in  the **tip-548** branch.
<https://core.tcl.tk/tcl/timeline?r=tip-548>

# Copyright

This document has been placed in the public domain.
|







 







|



|

|










|

|









|

|

|

|

|
|







|



|
|



|



|
|

|




|
|









1
2
3
4
5
6
7
8
..
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# TIP 548:Deprecate `Tcl_WinUtfToTChar()` and `Tcl_WinTCharToUtf()` and provide more flexible replacement functions.
	Author:         Jan Nijtmans <[email protected]>
	Author:         Jan Nijtmans <[email protected]>
	State:          Draft
	Type:           Project
	Vote:           Pending
	Created:        3-June-2019
	Post-History:   
................................................................................
	Keywords:       Tcl
	Tcl-Version:    8.7
	Tcl-Branch:     tip-548
-----

# Abstract

This TIP proposes to deprecate `Tcl_WinUtfToTChar()` and `Tcl_WinTCharToUtf()` and provide more flexible replacement functions.

# Rationale

The functions `Tcl_WinUtfToTChar()` and `Tcl_WinTCharToUtf()` originally were functions able to do two different conversions,
depending on the runtime platform: On Windows 95/98/ME they performed conversions between Utf-8 and the Windows default encoding
(usually cp1252), on later Windows versions they convert between Utf-8 and Utf-16. The length parameter of `Tcl_WinTCharToUtf()`
always was in bytes, but most other Unicode-related Tcl functions expect their length in Unicode characters.

Since Windows 95/98/ME are not supported any more, it's time to fix this inconsistency.

# Specification

This document proposes:

 * Deprecate the following functions:

     `Tcl_WinUtfToTChar()`

     `Tcl_WinTCharToUtf()`

   If Tcl is compiled with either -DTCL\_UTF\_MAX=6 (which is not officially supported) or -DTCL\_NO\_DEPRECATED, those functions will
   no longer be available. In Tcl 9.0, those functions will be completely removed.

 * Enhance the Tcl\_UniCharToUtfDString() function such that the uniLength parameter is allowed to
   have the value -1. In that case, the UniChar string will be read up to the closing /u0000 character.

 * New replacement functions:

     `Tcl_UtfToUtf16DString()`, replaces `Tcl_WinUtfToTChar()`

     `Tcl_Utf16ToUtfDString()`, replaces `Tcl_WinTCharToUtf()`

     Those are the same as the already existing _UniChar_ variants (`Tcl_UniCharToUtfDString`/`Tcl_UtfToUniCharDString`), but they use an "unsigned short"
     pointer type in their signature stead of a "Tcl\_UniChar" pointer type, which is always 16-bits.
     `Tcl_Utf16ToUtfDString()` accepts - just as `Tcl_UniCharToUtfDString()` - the value -1 as length parameter.

     Those functions can be used if you want your extension to compile with `-DTCL_UTF_MAX=3`, `-DTCL_UTF_MAX=4` or `-DTCL_UTF_MAX=6`,
     but still want to use the 16-bit conversions independent on the `TCL_UTF_MAX` setting or Tcl\_UniChar type.

     Those functions are available on all platforms, not only Windows.

# How to upgrade.

In your extension, replace the call:

     `Tcl_WinUtfToTChar(....., bufPtr)`;
     
with the following two lines:

     `Tcl_DStringInit(bufPtr);`
     `Tcl_UtfToUtf16DString(....., bufPtr);`

And also, replace:

     `Tcl_WinTCharToUtf(....., bufPtr);`
     
with the following two lines:

     `Tcl_DStringInit(bufPtr);`
     `Tcl_Utf16ToUtfDString(....., bufPtr);`

If the `Tcl_WinTCharToUtf()` call originally had a "length" parameter not equal to -1, divide it by 2 (or ... don't multiply it by 2 any more).


# Compatibility

This is fully upwards compatible in Tcl 8.x, except if Tcl is compiled with `-DTCL_UTF_MAX=6` (not officially supported) or
`-DTCL_NO_DEPRECATED`. Starting with Tcl 9.0, the replacement functions should be used in stead.

# Reference Implementation

A reference implementation is available in  the **tip-548** branch.
<https://core.tcl.tk/tcl/timeline?r=tip-548>

# Copyright

This document has been placed in the public domain.