Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: e0807a61851b3ee9102b1ead7ad54e447c9822482d924a47d20db6d6b5495934
Ticket: 17a1cb8d6e2a51bde1d5d4a6e55f7d42e408cbbc
Tcl 9: "illegal byte sequence" ?!
User & Date: pointsman on 2022-12-12 23:44:57
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-plain"
  4. comment changed to:
    With 252e282cd21b (2022-12-12 06:11:22 UTC)
    
    # Create the test data
    package require Tcl 9
    set fd [open data.txt w+]
    fconfigure $fd -encoding utf-8
    puts $fd "A\U10FFFFBCDE"
    close $fd
    
    
    # The data is a valid UTF-8 encoded Unicode string
    # in the understanding of Tcl.
    
    # Try to read it
    package require Tcl 9
    set fd [open "data.txt"]
    fconfigure $fd -encoding utf-8 -strictencoding 1 -nocomplainencoding 0
    set data ""
    while {![eof $fd]} {
        append data [read $fd]
    }
    # Not reached with this test data
    puts [string length $data]
    close $fd
    
    I get:
    
    error reading "file6": illegal byte sequence
        while executing
    "read $fd"
        ("while" body line 2)
    etc.
    
    
    Expected behaviour:
    
    Read the data without raising error.
    
  5. foundin changed to: "9.0a4, 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: "Severe"
  12. status changed to: "Open"
  13. submitter changed to: "pointsman"
  14. subsystem changed to: "25. Channel System"
  15. title changed to: "Tcl 9: "illegal byte sequence" ?!"
  16. type changed to: "Bug"