Skip to content
Tcl Source Code View Ticket
Login

View Ticket

new test failures

Closed / Fixed1355b9a874fc8f6006320bd32d8c0458a1983b55Created 3 years agoUpdated 3 years ago
Descriptionplain2024-02-07 17:10:36
==== 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
Referenced by2
jan.nijtmanswiki2024-02-07 20:54:45

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 ....

jan.nijtmanswiki2024-02-07 21:01:44

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.

jan.nijtmans Ticket [1355b9a874]: 3 changes [History diff]2024-02-07 21:02:13
jan.nijtmanswiki2024-02-08 13:22:42

Found a solution: Fallback to cp1252 should _never_ happen for prefix-bytes in table encodings. Using that, all test-cases pass.

Log in (anonymous is fine) to add a comment.