Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8b2cd5c1b18cf9d5af64ec42e2334192daf374162a823c3855a4cf39cd3956d2
Ticket: 3fc3287497a7e281b96661f883c20e0e74a0fca7
TclGetProcessGlobalValue encodes information twice on Windows
User & Date: ralfixx on 2024-05-22 16:53:21
Changes

  1. icomment:
    Rats... Tcl-9 most probably still contains the same error as tcl-8, 
    since the NULL is actually the interp argument to a different function call 
    (Tcl_UtfToExternalDStringEx vs Tcl_UtfToExternalDString).
    
    So it seems to me that a patch equivalent to the below is required there as well.
    
    diff -u tcl8.6.14/generic/tclUtil.c\~ tcl8.6.14/generic/tclUtil.c
    --- tcl8.6.14/generic/tclUtil.c~	2024-01-24 20:26:26.000000000 +0100
    +++ tcl8.6.14/generic/tclUtil.c	2024-05-22 18:41:29.714937460 +0200
    @@ -4284,7 +4284,7 @@
     
     	    Tcl_MutexLock(&pgvPtr->mutex);
     	    epoch = ++pgvPtr->epoch;
    -	    Tcl_UtfToExternalDString(pgvPtr->encoding, pgvPtr->value,
    +	    Tcl_UtfToExternalDString(current, pgvPtr->value,
     		    pgvPtr->numBytes, &native);
     	    Tcl_ExternalToUtfDString(current, Tcl_DStringValue(&native),
     	    Tcl_DStringLength(&native), &newValue);
    
    Diff finished.  Wed May 22 18:41:54 2024
    
  2. login: "ralfixx"
  3. mimetype: "text/plain"