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
- assignee changed to: "nobody"
- cmimetype changed to: "text/plain"
- 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. - foundin changed to: "obsolete: 8.1"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- status changed to: "Open"
- submitter changed to: "nobody"
- subsystem changed to: "57. zlib"
- title changed to: "Tcl doesn't read utf-16 files properly"
- type changed to: "Bug"