Overview
| Artifact ID: | b5517f5a578ca95ad71e04ed0debfe5b67235545fa4d5da05cf2c8efce112888 |
|---|---|
| Ticket: | dc23c6419310c5f4d1d08c8681773e482e7a43b1
[read] fails, on encoding error, but current position advances anyway. |
| User & Date: | pooryorick on 2023-04-08 11:26:50 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
Given the following script, <blockquote><code><verbatim> set chan [file tempfile] chan configure $chan -translation binary -profile strict puts -nonewline $chan hello\xc0there chan configure $chan -encoding utf-8 -profile strict seek $chan 0 catch {read $chan} errmsg chan tell $chan ;# -> 5 </verbatim></code></blockquote> , there is an invalid utf-8 sequence starting at position 5. <code>read</code> produces an error and <code>chan tell</code> report that the current position in the file has advanced to byte <code>5</code>. Because the position has advanced, if the channel is not seekable, there is no way to adjust the channel configuration and try again. On such a failure, either the position in the file should remain what it was before the unsuccessful read, or the result up to byte 5 should be made available to the caller. - is_private changed to: "0"
- login: "pooryorick"
- priority changed to: "5 Medium"
- private_contact changed to: "2b2275eab1118e1fab0016cf1c5702893c6af86c"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "pooryorick"
- subsystem changed to: "- New Builtin Commands"
- title changed to:
[read] fails, on encoding error, but current position advances anyway.
- type changed to: "Bug"