Tcl Source Code

View Ticket
Login
2023-09-12
13:09 Closed ticket [0cd1ae596e]: Under strict encoding, gets returns an error even though a complete line is available plus 4 other changes artifact: ef77b8d764 user: jan.nijtmans
2023-04-14
07:23 Pending ticket [0cd1ae596e]. artifact: 551bdd5d36 user: pooryorick
07:23 Ticket [0cd1ae596e]: 5 changes artifact: 1d05229fee user: pooryorick
07:21
Fix for [0cd1ae596e709259], under strict encoding, [gets] returns an error even though a complete li... check-in: 67baae2829 user: pooryorick tags: trunk, main
2023-04-13
20:51 Ticket [0cd1ae596e] Under strict encoding, gets returns an error even though a complete line is available status still Open with 3 other changes artifact: 5c5ae2c807 user: pooryorick
20:51 Ticket [0cd1ae596e]: 3 changes artifact: ac1da1ef28 user: pooryorick
20:46 New ticket [0cd1ae596e]. artifact: 35c92d4b3a user: pooryorick

Ticket UUID: 0cd1ae596e70925906ace67831f123e6b2ec2035
Title: Under strict encoding, [gets] returns an error even though a complete line is available
Type: Bug Version:
Submitter: pooryorick Created on: 2023-04-13 20:46:59
Subsystem: - New Builtin Commands Assigned To: pooryorick
Priority: 5 Medium Severity: Important
Status: Closed Last Modified: 2023-09-12 13:09:51
Resolution: Fixed Closed By: jan.nijtmans
    Closed on: 2023-09-12 13:09:51
Description:

The following script should print the first line read from the file but instead it produces the error, "invalid or incomplete multibyte or wide character". There is a utf-8 encoding in the second line, not the first:

set chan [file tempfile]
chan configure $chan -encoding binary
# \xc0 is invalid in utf-8
puts -nonewline $chan a\nb\xc0\nc\n
flush $chan
seek $chan 0
chan configure $chan -encoding utf-8 -buffering none -eofchar {} -translation lf -profile strict
puts [gets $chan]

User Comments: pooryorick added on 2023-04-14 07:23:20:

Fixed in [67baae2829].