new test failures
==== chan-io-7.3 FilterInputBytes: split up character at EOF FAILED
==== Contents of test case:
set f [open $path(test1) w]
chan configure $f -encoding binary
chan puts -nonewline $f "1234567890123\x82\x4F\x82\x50\x82"
chan close $f
set f [open $path(test1)]
chan configure $f -encoding shiftjis -profile tcl8
lappend x [chan gets $f line] $line
lappend x [chan tell $f] [testchannel inputbuffered $f] [chan eof $f]
lappend x [chan gets $f line] $line
---- Result was:
16 1234567890123\uFF10\uFF11\u201A 18 0 1 -1 {}
---- Result should have been (exact matching):
16 1234567890123\uFF10\uFF11\x82 18 0 1 -1 {}
==== chan-io-7.3 FAILED
==== io-7.3 FilterInputBytes: split up character at EOF FAILED
==== Contents of test case:
set f [open $path(test1) w]
fconfigure $f -encoding binary
puts -nonewline $f "1234567890123\x82\x4F\x82\x50\x82"
close $f
set f [open $path(test1)]
fconfigure $f -encoding shiftjis -profile tcl8
set x [list [gets $f line] $line]
lappend x [tell $f] [testchannel inputbuffered $f] [eof $f]
lappend x [gets $f line] $line
close $f
set x
---- Result was:
16 1234567890123\uFF10\uFF11\u201A 18 0 1 -1 {}
---- Result should have been (exact matching):
16 1234567890123\uFF10\uFF11\x82 18 0 1 -1 {}
==== io-7.3 FAILED
==== TableToUtf-bug-5be203d6ca Bug 5be203d6ca - truncated prefix in table encoding FAILED
==== Contents of test case:
set src \x82\x4f\x82\x50\x82
lassign [testencoding Tcl_ExternalToUtf shiftjis $src {start} 0 16 srcRead dstWritten charsWritten] buf
set result [list [testencoding Tcl_ExternalToUtf shiftjis $src {start} 0 16 srcRead dstWritten charsWritten] $srcRead $dstWritten $charsWritten]
lappend result {*}[list [testencoding Tcl_ExternalToUtf shiftjis [string range $src $srcRead end] {end} 0 10 srcRead dstWritten charsWritten] $srcRead $dstWritten $charsWritten]
---- Result was:
{multibyte 0 \xEF\xBC\x90\xEF\xBC\x91\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF} 4 6 2 {ok 0 \xE2\x80\x9A\x00\xFF\xFF\xFF\xFF\xFF\xFF} 1 3 1
---- Result should have been (exact matching):
{multibyte 0 \xEF\xBC\x90\xEF\xBC\x91\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xFF} 4 6 2 {ok 0 \xC2\x82\x00\xFF\xFF\xFF\xFF\xFF\xFF\xFF} 1 2 1
==== TableToUtf-bug-5be203d6ca FAILED
59328bf5a0Merge [35dfeb2a53bbdeac]: Fix all 'ascii' testcases in encodingVectors.tcl, another try. See [1355b9a874]. check-in2024-08-25 11:41:51233da96789Fix all 'ascii' testcases in encodingVectors.tcl, another try. See [1355b9a874]. check-in2024-02-08 13:21:02
It looks like the 'ascii' testcase fixes had a bad effect on the shiftjis encoding, which was not expected.
Reverted now, back to the drawing table ....
Using cp1252 as fallback is reasonable for ascii-based encodings, it is not reasonable for shiftjis (clearly indicated by this testcase). So, what's the best option? Don't use cp1252 as fallback for ascii (as in 8.6)? In 9.0 we have -profile strict as default, so the benefit of using cp1252 as fallback isn't that important any more.
So, we could simply decide not to use the cp1252 fallback for table-encodings. Then the current behavior of the 'ascii' encoding is fine.
Found a solution: Fallback to cp1252 should _never_ happen for prefix-bytes in table encodings. Using that, all test-cases pass.