Artifacts Associated With Ticket 5d70d14a09
Ticket change [3804b42113] (rid 236813) by anonymous on 2025-01-11 11:28:45:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
I have a following test (sources encoded as utf-8) --- all.tcl --- package require tcltest ::tcltest::runAllTests --------------- --- utf8.test --- package require tcltest 2.5 ::tcltest::test notascii {string corrupted when singleproc == 0} { string length "äöü" } 3 ----------------- Test passes in singleproc mode: > tclsh all.tcl -singleproc 1 Test fails for default run: > tclsh all.tcl Test files run in separate interpreters Running tests that match: * Skipping test files that match: l.*.test Only running test files that match: *.test Tests began at Sat Jan 11 13:04:12 EET 2025 utf-8.test ==== notascii string corrupted when singleproc == 0 FAILED ==== Contents of test case: string length "äöü" ---- Result was: 6 ---- Result should have been (exact matching): 3 ==== notascii FAILED Environment: tcl_platform(byteOrder) = littleEndian tcl_platform(engine) = Tcl tcl_platform(machine) = amd64 tcl_platform(os) = Windows NT tcl_platform(osVersion) = 10.0 tcl_platform(pathSeparator) = ; tcl_platform(platform) = windows tcl_platform(pointerSize) = 8 tcl_platform(threaded) = 1 tcl_platform(user) = user tcl_platform(wordSize) = 4 tcl = 8.6.17 tcltest = 2.5.9 Problem: tcltest's runAllTests sources test file as utf-8 for singleProc: --- tcltest-2.5.9.tm --- ... 2926: uplevel 1 [list ::source -encoding utf-8 $file] ... --- and runAllTests runs test file using system defaults otherwise --- tcltest-2.5.9.tm --- ... 2950: set cmd [linsert $childargv 0 | $shell $file] ... 2953: set pipeFd [open $cmd "r"] ... --- - foundin initialized to: "8.6.17"
- is_private initialized to: "0"
- login: "anonymous"
- priority initialized to: "5 Medium"
- private_contact initialized to: "adbf9acf8babf33ccf30baaf363c2949e21b82be"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "anonymous"
- subsystem initialized to: "34. tcltest Package"
- title initialized to:
tcltest: test result differs for different singleproc values
- type initialized to: "Bug"
Ticket change [c419b5ca92] (rid 236819) by jan.nijtmans on 2025-01-11 23:03:46:
- icomment:
Let me guess. What does "encoding system" give on your system? Does it look like?: <pre> $ tclsh86 % encoding system cp1252 </pre> If so, the answer with -singleproc is wrong, the default run is right. Since the source-file is considered cp1252, the length of the string is indeed 6. What we can do is sourcing "all.tcl" in utf-8 regardless of the system-encoding. See [5e8914a8ad|here]
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [ed366cc5f7] (rid 236820) by jan.nijtmans on 2025-01-11 23:52:28:
- icomment: "Hm. that doesn't work ....."
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
Ticket change [fd26621362] (rid 236822) by anonymous on 2025-01-12 07:19:54:
- icomment:
Sorry, I didn't make it clear that the test file should be saved in utf-8 encoding. C:\Temp>tclsh % encoding system cp1251 C:\Temp>file utf-8.test utf-8.test: Tcl script, Unicode text, UTF-8 text, with CRLF line terminators My system encoding is cyrillic cp1251 but the test with cyrillic chars also failed --- utf-8.test --- package require tcltest 2.5 ::tcltest::test notascii_cyr {string corrupted when singleproc == 0} { string length "іїє" } 3 ------------------ ==== notascii_cyr string corrupted when singleproc == 0 FAILED ==== Contents of test case: string length "їіє" ---- Result was: 6 ---- Result should have been (exact matching): 3 ==== notascii_cyr FAILED - login: "anonymous"
- mimetype: "text/plain"
- icomment:
Ticket change [7606176846] (rid 236823) by anonymous on 2025-01-12 07:34:06:
- icomment:
And yes, am using -encoding utf-8 for tclsh But runAllTest (when singleproc==0) 'exec' secondary tclsh without '-encoding utf-8'. > tclsh -encoding utf-8 all.tcl -singleproc 0 fails > tclsh -encoding utf-8 utf-8.test works
- login: "anonymous"
- mimetype: "text/plain"
- icomment:
Ticket change [f09f3dac48] (rid 253751) by apnadkarni on 2026-05-22 09:45:34:
- closedate changed to: "2461182.9066543058"
- closer changed to: "apnadkarni"
- icomment:
Closing as won't fix. Issues does not exist in 9.0 and 8.6 is EOL.
- login: "apnadkarni"
- mimetype: "text/plain"
- resolution changed to: "Wont Fix"
- status changed to: "Closed"