Overview
| Artifact ID: | 172b710a2a23ed369b4538794372d8785b8aecbd |
|---|---|
| Ticket: | 535705ffffffffffffffffffffffffffffffffff
Tcl interface to stop on encoding errors |
| User & Date: | nobody on 2002-03-27 13:19:11 |
Changes
- assignee changed to: "dkf"
- cmimetype changed to: "text/plain"
- comment changed to:
When [encoding convertto] encounters a character that cannot be represented in the target encoding, it silently substitutes a default instead. In the C interface there is a flag TCL_ENCODING_STOPONERROR which instead causes the underlying function to return with an error when this condition occurs. It would be useful to have a switch for [encoding convertto] to get the same behaviour there, especially for cross-platform installation programs (where encoding conversions are common and unnoticed character substitutions can be very dangerous). PS: While I'm at [encoding] anyway, I might as well point out that the man page for the [encoding] command (of Tcl8.4 as currently on tcl.activestate.com) in the Example section incorrectly claims that "because the source command always reads files using the ISO8859-1 encoding, Tcl will treat each byte in the file as a separate character that maps to the 00 page in Unicode". I believe the truth is rather that [source] uses the system encoding. The example should work, since \xHH produces character in said Unicode page, but including the corresponding bytes as explicit characters in the source probably won't work cross-platform.
- foundin changed to: "None"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "16. Commands A-H"
- title changed to: "Tcl interface to stop on encoding errors"
- type changed to: "RFE"