Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 57686b3cd4e60f30e4c3b215667fcb927932ce29
Ticket: 436332ffffffffffffffffffffffffffffffffff
Need way to append bytearray objs
User & Date: davidw on 2001-07-06 18:30:09
Changes

  1. icomment:
    Logged In: YES 
    user_id=240
    
    Well, Tcl_AppendObjToObj actually seems to work ok.  I am
    able to manipulate a jpeg with it with no corruption.  It
    translates its bytes into UTF, whereas Tcl_AppendToObj does
    not.  My quick fix is the following:
    
    --- tclStringObj.c2001/05/15 21:30:461.21
    +++ tclStringObj.c2001/07/06 11:22:56
    @@ -979,7 +979,8 @@
     
     stringPtr = GET_STRING(objPtr);
         } else {
    -
    AppendUtfToUtfRep(objPtr, bytes, length);
    +
    Tcl_Obj *appendObj = Tcl_NewByteArrayObj(bytes, length);
    +
    Tcl_AppendObjToObj(objPtr, appendObj);
         }
     }
    
    Maybe there is a more efficient way of transforming the
    bytes to UTF?  Is it worthwhile making a special case in
    order to speed up this operation? (i.e., check to see if
    objptr is a bytearray here, and also in objtoobj).
    
    
  2. login: "davidw"
  3. mimetype: "text/plain"
  4. username: "davidw"