Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 35c92d4b3ac131e1afe2fad6423c0ca33621c9ff71f5698d3ee8780d06fdd480
Ticket: 0cd1ae596e70925906ace67831f123e6b2ec2035
Under strict encoding, [gets] returns an error even though a complete line is available
User & Date: pooryorick on 2023-04-13 20:46:59
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    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:
    
    <blockquote><code><verbatim>
    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]
    </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:
    Under strict encoding, [gets] returns an error though when a complete line is available
    
  15. type changed to: "Bug"