Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2026-03-11
05:58 • Closed ticket [d1a39e8c28]: Inconsistent use of TCL_ENCODING_NO_TERMINATOR p... artifact: c91762bd52 user: apnadkarni
2023-03-12
17:33 • Ticket [d1a39e8c28]: 3 changes artifact: c54b8a849e user: apnadkarni
17:06 • Ticket [d1a39e8c28]: 4 changes artifact: 33283e1365 user: apnadkarni
16:45 • New ticket [d1a39e8c28]. artifact: b7c0f917b0 user: apnadkarni

Inconsistent use of TCL_ENCODING_NO_TERMINATOR

Closed / Fixedd1a39e8c28d35dca1afc97cbf9006c1b9298f816Created 4 years agoUpdated 267 days ago
Descriptionmarkdown2023-03-12 16:45:05

The Tcl_ExternalToUtf function does not append a terminating nul (by design) if the TCL_ENCODING_NO_TERMINATE flag is specified. This is useful functionality. However, the complementary Tcl_UtfToExternal function ignores this flag and always appends a null.

This is surprising behavior as flags are commonly defined for the two functions so Tcl_UtfToExternal should also obey this flag.

Moreover, this flag is useful and public in tcl.h but is undocumented in a manpage or TIP afaict. It should be documented for use by extensions (for 8.7 at least) or moved to tclInt.h.

apnadkarni Ticket [d1a39e8c28]: 4 changes [History diff]2023-03-12 17:06:54
apnadkarni Ticket [d1a39e8c28]: 3 changes [History diff]2023-03-12 17:33:37
apnadkarniplain2026-03-11 05:58:00
Fixed via TIP 737.
Log in (anonymous is fine) to add a comment.