Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e9b1a98398fc6dcc652821ac3aee9e4a7b337e86a180b3baf63bc05276ad32b0
Ticket: b8f575aa2398b0e44b5a037326b9d75037e2da4a
Tcl 9: eof erroneously flagged with not reported encoding read error
User & Date: pointsman on 2022-12-08 22:59:16
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    Create the test data:
    
    set myfd [open "data.txt" w+]
    fconfigure $myfd -encoding binary
    puts -nonewline $myfd A\x81BCDEFG
    close $myfd
    
    Then try this:
    
    set myfd [open "data.txt"]
    fconfigure $myfd -encoding utf-8 -strictencoding true -nocomplainencoding false
    set data [read $myfd]
    puts "eof [eof $myfd]"
    puts "fblocked [fblocked $myfd]"
    puts "data length [string length $data]"
    puts "data: $data"
    set data [read $myfd]
    
    I get:
    
    eof 1
    fblocked 0
    data length 1
    data: A
    error reading "file6": illegal byte sequence
        while executing
    "read $myfd"
        invoked from within
    "set data [read $myfd]"
    
    
    I guess this isn't supposed to work this way?
    
  5. foundin changed to: "9.04a, trunk"
  6. is_private changed to: "0"
  7. login: "pointsman"
  8. priority changed to: "5 Medium"
  9. private_contact changed to: "4ca203a8e925aecdd9419645f936bccf18cd6ea7"
  10. resolution changed to: "None"
  11. severity changed to: "Important"
  12. status changed to: "Open"
  13. submitter changed to: "pointsman"
  14. subsystem changed to: "25. Channel System"
  15. title changed to: "Tcl 9"
  16. type changed to: "Bug"