Overview
| Artifact ID: | 68bde393d2c3ee6b27df65e65a020ea3cb87cca6 |
|---|---|
| Ticket: | 3312630fffffffffffffffffffffffffffffffff
drivers lack controls over encodings |
| User & Date: | dgp on 2011-06-06 18:06:27 |
Changes
- assignee changed to: "andreas_kupries"
- cmimetype changed to: "text/plain"
- comment changed to:
The typical Tcl_Channel may code into its Tcl_DriverOutputProc() an assumption that the bytes coming in are in a particular encoding. Such a channel type will typically include in its channel creation command after a call to Tcl_CreateChannel() another call to Tcl_SetOption() to set the initial default encoding of the channel to what it expects. However, the Tcl_Channel system give the driver no power to override, refuse, or prevent a [chan configure] or equivalent to set the encoding of the channel to a new value, one inconsistent with the assumptions of the OutputProc. The public routines necessary to workaround this possible mismatch within the OutputProc (read the current encoding setting and convert to what's needed if needed) are weak, and the resulting error prevention stanzas are something every OutputProc concerned about this issue would need to clumsily reproduce. While these facts remain true, the implied position of Tcl on channel encodings is that anyone using [chan configure] to set an encoding takes responsibility for any breakage induced. Whenever an opportunity arises to consider the next version of the Tcl_Channel driver interface, some possible improvements to deal with this would be: 1) Routinely pass in the Tcl_Channel to driver routines, rather than expect every driver to stick a field for it into its ClientData. 2) A routine taking a Tcl_Channel that returns the Tcl_Encoding(s) currently in use on that channel without the need for the caller to do the ugly string translations, lifetime management, etc, for itself. 3) A means by which a driver could refuse an encoding change. - foundin changed to: "None"
- is_private changed to: "0"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "dgp"
- subsystem changed to: "25. Channel System"
- title changed to: "drivers lack controls over encodings"
- type changed to: "RFE"