Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: cd8fcfd3ad33fff21c2c2a62839b4fc96fd0ac79
Ticket: 983509ffffffffffffffffffffffffffffffffff
Tcl_RegisterConfig ignores encoding failure
User & Date: dgp on 2013-07-05 16:17:56
Changes

  1. assignee changed to: "aku"
  2. closer changed to: "nobody"
  3. comment changed to:
    Tcl_RegisterConfig() receives a "valEncoding"
    argument that specifies the encoding for
    the string values in the "configuration" table
    of values.  Those values are copied into
    a dictionary, converting to UTF-encoding.
    
    Problem arises when
    Tcl_GetEncoding(NULL, valEncoding)
    returns NULL -- essentially meaning the
    appropriate *.enc file for that encoding could
    not be found.
    
    In that circumstance, T_RC ignores the
    encoding failure, and goes ahead an
    converts the config values according
    to whatever Tcl thinks the system encoding
    is at the moment.  
    
    Since T_GE() failed, we know this cannot
    be the right thing -- we are definitely converting
    based on the wrong encoding -- and worse, we
    can't even predict what wrong thing T_RC
    will do instead.
    
    When the "valEncoding" cannot be found,
    no data should be copied over to the
    dictionary, since it cannot be done correctly.
    Whether [pkgconfig] should also not be defined,
    or whether it should be defined with no data,
    I'm not sure.
    
  4. icomment:
    Checkins [341f682e08] (8.5) and [6189063c4d] (8.6,trunk)
    have fixed this bug by re-designing it out of existence.
    
    Now these values are stored as bytes, and the encoding
    name is also stored and interpretation of the bytes according
    to that encoding is delayed until the values are retrieved.
    At that time, it's at least likelier that enough initialization
    is complete that encoding conversion will happen successfully.
    If not, the error can arise then rather than during interp creation.
    
  5. login: "dgp"
  6. mimetype: "text/plain"
  7. severity changed to: "Minor"