Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 48565382226bb0903a80bde0dfe2db7677c079292ff779802f6650eae2fda0e1
Ticket: 8a13caa31dd8e3a546b8d44c235bb98cd52bd774
Setting of system encoding isn't applied to stdout on certain circumstances
User & Date: apnadkarni on 2025-08-17 11:23:36
Changes

  1. icomment:
    Curiously, tclsh passes the test fine, tcltest fails. So likely some difference in the initialization sequence. I'm also wondering why the read output is nuls. Definitely worth tracking down.
    
    tclsh:
    
    ```
    c:\src\tcltk\wip\tcl\win>Release_AMD64_VC1939\tclsh90.exe ..\tests\all.tcl -file encoding.test -match encoding-24.3 -singleproc 1
    Tests running in interp:  c:/src/tcltk/wip/tcl/win/Release_AMD64_VC1939/tclsh90.exe
    ...blah blah...
    
    Tests ended at 2025-08-17 16:48:47 +0530
    all.tcl:        Total   212     Passed  1       Skipped 211     Failed  0
    ```
    
    tcltest on the other hand:
    
    ```
    c:\src\tcltk\wip\tcl\win>Release_AMD64_VC1939\tcltest90.exe ..\tests\all.tcl -file encoding.test -match encoding-24.3 -singleproc 1
    Tests running in interp:  c:/src/tcltk/wip/tcl/win/Release_AMD64_VC1939/tcltest90.exe
    ...blah blah...
    
    
    ==== encoding-24.3 EscapeFreeProc on open channels FAILED
    ==== Contents of test case:
    
        # Bug #219314 - if we don't free escape encodings correctly on channel
        # closure, we go boom
        set file [makeFile {
            encoding system iso2022-jp
            set a "乎乞也"; # 3 Japanese Kanji letters
            puts $a
        } iso2022.tcl]
        set f [open "|[list [interpreter] $file]"]
        fconfigure $f -encoding iso2022-jp
        set count [gets $f line]
        close $f
        removeFile iso2022.tcl
        list $count $line
    
    ---- Result was:
    9 \x00\x00\x00\x00\x00\x00\x00\x00\x00
    ---- Result should have been (exact matching):
    3 \u4E4E\u4E5E\u4E5F
    ==== encoding-24.3 FAILED
    ```
    
  2. login: "apnadkarni"
  3. mimetype: "text/x-markdown"