Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 725fbc71132f312cdbe72ed0148b4774398dff963886a6d9eb5dacff3c0921c8
Ticket: 3fc3287497a7e281b96661f883c20e0e74a0fca7
TclGetProcessGlobalValue encodes information twice on Windows
User & Date: ralfixx on 2024-05-22 16:29:42
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-plain"
  4. comment changed to:
    If the hostname on Windows contains an Umlaut, [info hostname] will return a different value when invoked for the second time:
    
        % tclsh8.6
        % info hostname
        foo-läptop
        % info hostname
        foo-läpt
    
    For TCL 9, there has been a change to generic/tclUtil.c, TclGetProcessGlobalValue() 
    where in the call to UtfToExternalDStringEx() the first argument 
    was changed from pgvPtr->encoding to NULL.
    
    Also, if I change in the debugger the argument at that call to NULL, 
    the correct  information is returned at the second call.
    
    tcl 8.6, 8.7
    	    Tcl_UtfToExternalDString(pgvPtr->encoding, pgvPtr->value,
    		    pgvPtr->numBytes, &native);
    	    Tcl_ExternalToUtfDString(current, Tcl_DStringValue(&native),
    	            Tcl_DStringLength(&native), &newValue);
    
    tcl 9.0b2
    	    Tcl_UtfToExternalDStringEx(NULL, pgvPtr->encoding, pgvPtr->value,
    		pgvPtr->numBytes, TCL_ENCODING_PROFILE_TCL8, &native, NULL);
    	    Tcl_ExternalToUtfDStringEx(NULL, current, Tcl_DStringValue(&native),
    		Tcl_DStringLength(&native), TCL_ENCODING_PROFILE_TCL8,
    		&newValue, NULL);
    
    This logical fix should be applied to tcl 8 as well. 
    Unfortunately I'm not fluent enough in the Web-interface to find the commit which did that change :-/
    
  5. foundin changed to: "8.6.14"
  6. is_private changed to: "0"
  7. login: "ralfixx"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "1d3c95db24e116878d6afed7cf890a89a0effe62"
  10. resolution changed to: "None"
  11. severity changed to: "Minor"
  12. status changed to: "Open"
  13. submitter changed to: "ralfixx"
  14. subsystem changed to: "- New Builtin Commands"
  15. title changed to:
    TclGetProcessGlobalValue encodes information twice on Windows
    
  16. type changed to: "Bug"