Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8a7a92d0ff176adbde91c7c982152591f8d8e91a
Ticket: 9b2e63636199b969e480a2a5fdba09588b0f0170
Tcl_CreateInterp() needs initialized encoding search path
User & Date: dgp on 2013-07-05 16:53:26
Changes

  1. closedate changed to: "2456479.20377863"
  2. icomment:
    Yes this change is a fix for [983509] (why isn't
    this a link?).
    
    PGV is not helpful here.  These values are stored
    per-interp, so a process-global thing isn't useful.
    
    So this patch is a good one.
    
    I don't think the description is as helpful as
    it ought to be, since the notion of "initialized
    encodings" covers multiple stages.
    
    The first stage is the call to TclInitEncodingSubsystem(),
    which is called by TclInitSubsystems() which in turn is
    called early by Tcl_CreateInterp(), so that level of 
    initialization is always complete and not an issue.  This
    means the core machinery is set up and the set of built-in
    encodings (identity, utf-8, unicode, iso8859-1) is ready
    to go.
    
    The second stage is the call to TclpSetInitialEncodings()
    which this patch delays until after Tcl_CreateInterp() is
    complete.  The only thing functionally that call does is 
    to (try to) set the value of [encoding system] to match
    the value it detects the environment expects it to have.
    Since the workings of Tcl_RegisterConfig() don't make use
    of the system encoding, the direct effect of that routine
    doesn't really matter here.
    
    The third stage is getting the [encoding dirs] search path
    set up to locate where the *.enc files are actually stored.
    This isn't done explicitly by Tcl initialization.  Instead
    either the first [encoding dirs] command in init.tcl or
    the first attempt to use an encoding that is not built-in
    will cause the default search path to be established by the
    routine InitializeEncodingSearchPath().  In some embedding
    scenarios -- notably kit things that store *.enc in a 
    script-powered VFS -- this default path won't be a successful
    one, and a later [encoding dirs $path] will need to establish
    a fully working encoding system.
    
    It's the third stage that's really the issue here, so I revised
    the Title to make that more clear.
    
  3. login: "dgp"
  4. mimetype: "text/plain"
  5. title changed to:
    Tcl_CreateInterp() needs initialized encoding search path