Overview
| Artifact ID: | c1ac2eced929e7c63ad2e76ac71f94699ca9c19ce3934c76c8c5a41cbb1a5eb6 |
|---|---|
| Ticket: | 382e6c509c7c0355f3e362ab16b8706339b98cd7
[read] loses data under strict encoding |
| User & Date: | pooryorick on 2023-04-14 09:33:18 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
In the following script, the sequence \xc0\x40 is invalid for utf-8, and <code>read</code> produces an error. When the profile is changed to "replace", <code>read</code> should then produce <code>AB...</code>, but instead it loses <code>AB</code> and produces characters starting at the invalid sequence. <blockquote><code><verbatim> set chan [file tempfile] chan configure $chan -translation binary # This is not valid UTF-8 puts $chan helloAB\xc0\x40CD\nEFG flush $chan seek $chan 0 chan configure $chan -encoding utf-8 -profile strict set data [read $chan 5]; #-> hello puts $data catch {read $chan 5} res ;#-> error message puts $res chan configure $chan -profile replace set data [read $chan 5] ;#-> does not start with "AB" puts $data </verbatim></code></blockquote> - is_private changed to: "0"
- login: "pooryorick"
- priority changed to: "5 Medium"
- private_contact changed to: "2b2275eab1118e1fab0016cf1c5702893c6af86c"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "pooryorick"
- subsystem changed to: "- New Builtin Commands"
- title changed to: "[read] loses data under strict encoding"
- type changed to: "Bug"