Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 7ce0b271fb320df9f284f7e9c51700c1bfc4a1e4
Ticket: 218157ffffffffffffffffffffffffffffffffff
UTF cleanliness in the 7.6 (string) interface
User & Date: nobody on 2000-10-26 00:53:54
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 2186 RFE
    Version: 8.1.1
    SubmitDate: '1999-06-07'
    LastModified: '1999-09-01'
    Severity: MED
    Status: Closed
    Submitter: techsupp
    ChangedBy: hobbs
    OS: Windows NT
    OSVersion: 4.0 sp5
    Machine: X86
    FixedDate: '2000-10-25'
    ClosedDate: '1999-09-01'
    
    
    Name:
    David Gravereaux
    
    Comments:
    here's the global wrapper code I'm using to show you what I'm doing:
        
        static int fake_Cmd (ClientData clientData, Tcl_Interp *interp,
                          int argc, char *argv[]) 
        {
         Tcl_DString *dst;
         XiRCFakeData *data = (XiRCFakeData *) clientData;
         int i,rtn = TCL_ERROR;
        
          // set the size
          dst = new Tcl_DString[argc];
        
          // decode args from UTF-8 into iso8859-1
          for (i=0; i<argc; i++) {
            Tcl_DStringInit(&dst[i]);
        
        Tcl_UtfToExternalDString(Tcl_GetEncoding(NULL,"iso8859-1"),argv[i],-1,&ds
        t[i]);
            argv[i] = Tcl_DStringValue(&dst[i]);
          }
        
          // calling into XiRCON
          rtn = (data->proc)(data->data,interp,argc,argv);
        
          for (i=0; i<argc; i++) {
            Tcl_DStringFree(&dst[i]);
          }
          delete dst;
        
          return rtn;
        };
    
    DesiredBehavior:
    I recently patched an old program that used 7.6p2 and upgraded it to use
        8.1.1 .  I discovered that the argv[] array given to the Tcl commands
        this program provides to the interp is in UTF-8.  It wasn't difficult to
        fix, but for true backward compatibility I think Tcl 8.1.x should do it
        automaticly without needing to wrap each command with a decoding
        routine.
    
    
    
    8.1+ is full UTF in the internals.  While this is an interesting
    and useful between step for people upgrading, it would not be
    good to change this at the core level.  The same goes for objects
    and the use of StringifyObjects between 7 and 8. 
    -- 09/01/1999 hobbs
    
  4. foundin changed to: "final: 8.1.1"
  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: "69. Other"
  10. title changed to: "UTF cleanliness in the 7.6 (string) interface"
  11. type changed to: "RFE"