Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 4b2cae1fcfab9d5331b9c95d7e2de899721b5a723dd9e23ce5ca7e0209fb2c19
Ticket: 154ed7ce564a7b4cc39463d643b251969006c247
Tcl 9: [gets] on -strictencoding 1 configured channel
User & Date: pointsman on 2022-12-22 13:15:31
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/plain"
  4. comment changed to:
    # Create the data
    package require Tcl 9
    set fd [open "data.txt" w+]
    fconfigure $fd -encoding binary
    # This is not valid UTF-8
    puts $fd AB\xc0\x40CD\nEFG
    close $fd
    
    # Now try to read it with [gets]
    set fd [open "data.txt"]
    fconfigure $fd -encoding utf-8 -strictencoding 1
    # That next line will hang indefinitely
    set data [gets $fd]
    puts "not reached"
    close $fd
    puts $data
    
    I'm not sure how this is supposed to work 
    but it surely should not work this way.
    
  5. foundin changed to: "Tcl 9.0, 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: "[gets] on -strictencoding 1 configured channel"
  16. type changed to: "Bug"