Overview
| Artifact ID: | a90b13432a8ba8dc017b9b75e96d1b86c095dc6ca65f87573e61ef461b3581a7 |
|---|---|
| Ticket: | 8a13caa31dd8e3a546b8d44c235bb98cd52bd774
Setting of system encoding isn't applied to stdout on certain circumstances |
| User & Date: | sebres on 2025-08-16 23:02:32 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
I like it when an experimental branch brings to light problems that essentially have nothing to do with the experiment itself. My lazy branch (commit [6a997a7f19eaa6fa]) I provided for [effa2e2346f8372a] shows following error in encoding.test now: <code><pre style="margin-left:5pt"> ==== 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 </pre></code> (this is even valid for single test too, e. g. with <code>-file encoding.test -match encoding-24.3 -singleproc 1</code>) This particularly means that <code>[encoding system iso2022-jp]</code> doesn't change the encoding of stdout (it remains utf-8 in child process, so the parent reads a "noise").<br/> Changing of stdout encoding directly like here "fixes" the test: <code><pre style="margin-left:5pt"> - encoding system iso2022-jp + fconfigure stdout -encoding iso2022-jp </pre></code> Also it is not clear why before the commit [6a997a7f19eaa6fa] it works as expected.<br/> As if moving of some inits (like Tcl_PkgProvideEx) has reached a "critical mass"... Or as something in package mechanisms touched encoding somewhere in different way and it appears now. Since it looks like an ugly Heisenbug and it is encoding issue (again), I think it were good to document this strange behavior. - foundin changed to: "9.0"
- is_private changed to: "0"
- login: "sebres"
- priority changed to: "5 Medium"
- private_contact changed to: "50e9528765c18296566374b3fde2df942c394efd"
- resolution changed to: "None"
- severity changed to: "Severe"
- status changed to: "Open"
- submitter changed to: "sebres"
- subsystem changed to: "20. [interp]"
- title changed to:
Setting of system encoding isn't applied to stdout on certain circumstances
- type changed to: "Bug"