Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 08ca84a85267de586b1dedd341939e7b68ed0cbb54d5a45f9a63d5fac789e50c
Ticket: eabcbd08274f2d22351fa96d972e4abfd08a8329
[read] error persists on channel with strict encoding after encoding is changed to binary
User & Date: pooryorick on 2023-04-16 23:02:06
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    In the script below, after the first [read] returns an encoding error, the
    channel is reconfiguredi to <code>-encoding iso8859-1</code>, and the
    subsequent [read] should return character <code>\x81</code>, but instead it
    repeats the error:
    
    <blockquote><code><verbatim>
    set res {}
    set chan [file tempfile]
    fconfigure $chan -encoding binary
    # \x81 is invalid in utf-8. -eofchar is not detected, because it comes later.
    puts -nonewline $chan A\x81\x1A
    flush $chan
    seek $chan 0
    fconfigure $chan -encoding utf-8 -buffering none -eofchar \x1A \
    -translation lf -profile strict
    catch {read $chan} cres
    puts $cres ;#-> error reading "file*": invalid or incomplete multibyte or wide character
    puts [list eof [eof $chan]] ;#-> eof 1
    puts [list position [tell $chan]] ;#-> position 1
    chan configure $chan -encoding iso8859-1
    catch {read $chan} cres
    puts $cres] ;#-> error reading "file*": invalid or incomplete multibyte or wide character
    </verbatim></code></blockquote>
    
  5. is_private changed to: "0"
  6. login: "pooryorick"
  7. priority changed to: "5 Medium"
  8. private_contact changed to: "2b2275eab1118e1fab0016cf1c5702893c6af86c"
  9. resolution changed to: "None"
  10. severity changed to: "Important"
  11. status changed to: "Open"
  12. submitter changed to: "pooryorick"
  13. subsystem changed to: "- New Builtin Commands"
  14. title changed to:
    [read] error persists on channel with strict encoding after encoding is changed to binary
    
  15. type changed to: "Bug"