Overview
| Artifact ID: | cd8fcfd3ad33fff21c2c2a62839b4fc96fd0ac79 |
|---|---|
| Ticket: | 983509ffffffffffffffffffffffffffffffffff
Tcl_RegisterConfig ignores encoding failure |
| User & Date: | dgp on 2013-07-05 16:17:56 |
Changes
- assignee changed to: "aku"
- closer changed to: "nobody"
- 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.
- 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.
- login: "dgp"
- mimetype: "text/plain"
- severity changed to: "Minor"