Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 172b710a2a23ed369b4538794372d8785b8aecbd
Ticket: 535705ffffffffffffffffffffffffffffffffff
Tcl interface to stop on encoding errors
User & Date: nobody on 2002-03-27 13:19:11
Changes

  1. assignee changed to: "dkf"
  2. cmimetype changed to: "text/plain"
  3. 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.
    
    
  4. foundin changed to: "None"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "16. Commands A-H"
  10. title changed to: "Tcl interface to stop on encoding errors"
  11. type changed to: "RFE"