Skip to content
Tcl Source Code History Of Ticket 382e6c509c
Login

History Of Ticket 382e6c509c

Artifacts Associated With Ticket 382e6c509c

  1. Ticket change [c1ac2eced9] (rid 212829) by pooryorick on 2023-04-14 09:33:18:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/x-fossil-wiki"
    4. comment initialized 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>
      
    5. is_private initialized to: "0"
    6. login: "pooryorick"
    7. priority initialized to: "5 Medium"
    8. private_contact initialized to: "2b2275eab1118e1fab0016cf1c5702893c6af86c"
    9. resolution initialized to: "None"
    10. severity initialized to: "Important"
    11. status initialized to: "Open"
    12. submitter initialized to: "pooryorick"
    13. subsystem initialized to: "- New Builtin Commands"
    14. title initialized to: "[read] loses data under strict encoding"
    15. type initialized to: "Bug"