Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 1f1aec943cd5927b915142ff9b44c667e98f89de
Ticket: 219289ffffffffffffffffffffffffffffffffff
Tcl doesn't read utf-16 files properly
User & Date: nobody on 2000-10-26 05:10:04
Changes

  1. assignee changed to: "nobody"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    OriginalBugID: 2129 Bug
    Version: 8.1
    SubmitDate: '1999-05-26'
    LastModified: '1999-10-21'
    Severity: MED
    Status: UnAssn
    Submitter: pat
    ChangedBy: hobbs
    RelatedBugIDs: 2128
    OS: Other
    Machine: NA
    FixedDate: '2000-10-25'
    ClosedDate: '2000-10-25'
    
    
    Name:
    Victor Wagner
    
    ReproducibleScript:
    tclsh8.1 >testfile <<!
        fconfigure stdout -encoding unicode
        puts "\uFEFFSome stuff
        !
        dd if=testfile of=testin conv=swab
        tclsh8.1 <<!
        set f [open testin]
        fconfigure \$f -encoding unicode
        fconfigure stdout -encoding [encoding system]
        puts [read \$f]
        !
    
    ObservedBehavior:
    When reading utf-16 file Tcl doesn't recongize byte order
        automatically.
        According to utf-16 specification, each unicode text file should
        contain
        "\uFEFF" as first character, which allows to determine byte order
        automatically.
        But Tcl doesn't pay attention to this characher. So, if proper UTF-16
        file is constructed on MSB-first machine and then read by Tcl on
        LSB-first
        machine of vice versa, it doesn't read properly. On contrary, MS-Word 97
        read
        such files without problems (at least ones with less than 256 chars)
    
    DesiredBehavior:
    When reading unicode files, tcl should pay attention to firsh characher
        and if it is FFFE, switch to opposite byte order.
    
    
    
    
    
  4. foundin changed to: "obsolete: 8.1"
  5. priority changed to: "5 Medium"
  6. resolution changed to: "None"
  7. status changed to: "Open"
  8. submitter changed to: "nobody"
  9. subsystem changed to: "57. zlib"
  10. title changed to: "Tcl doesn't read utf-16 files properly"
  11. type changed to: "Bug"