Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2024-11-11
00:13 • Ticket [0cd1ae596e] Under strict encoding, gets returns an error even though a... artifact: 526ef6797a user: pooryorick
2023-09-12
13:09 • Closed ticket [0cd1ae596e]. 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... artifact: 5c5ae2c807 user: pooryorick
20:51 • Ticket [0cd1ae596e]: 3 changes artifact: ac1da1ef28 user: pooryorick
20:46 • New ticket [0cd1ae596e]. artifact: 35c92d4b3a user: pooryorick

Under strict encoding, [gets] returns an error even though a complete line is available

Closed / Fixed0cd1ae596e70925906ace67831f123e6b2ec2035Created 4 years agoUpdated 2 years ago
Descriptionwiki2023-04-13 20:46:59
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]
pooryorick Ticket [0cd1ae596e]: 3 changes [History diff]2023-04-13 20:51:05
pooryorick Ticket [0cd1ae596e]: 3 changes [History diff]2023-04-13 20:51:18
pooryorickwiki2023-04-14 07:23:20

Fixed in [67baae2829].

pooryorick Pending ticket [0cd1ae596e]. [History diff]2023-04-14 07:23:41
jan.nijtmans Closed ticket [0cd1ae596e]. [History diff]2023-09-12 13:09:51
pooryorick Ticket [0cd1ae596e]: 5 changes [History diff]2024-11-11 00:13:16
Log in (anonymous is fine) to add a comment.