Skip to content
Tcl Source Code View Ticket
Login

View Ticket

UTF cleanliness in the 7.6 (string) interface

Closed / Fixed218157ffffffffffffffffffffffffffffffffffCreated 26 years agoUpdated 25 years ago
Descriptionplain2000-10-26 00:53:54
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
welch Closed ticket [218157ffff]. [History diff]2000-10-26 08:15:57
dgp Open ticket [218157ffff]. [History diff]2001-04-21 13:23:46
dkf Closed ticket [218157ffff]. [History diff]2001-06-26 05:52:18
Log in (anonymous is fine) to add a comment.