.
D 2000-10-26T05:10:04
J assignee nobody
J cmimetype text/plain
J comment OriginalBugID:\s2129\sBug\nVersion:\s8.1\nSubmitDate:\s'1999-05-26'\nLastModified:\s'1999-10-21'\nSeverity:\sMED\nStatus:\sUnAssn\nSubmitter:\spat\nChangedBy:\shobbs\nRelatedBugIDs:\s2128\nOS:\sOther\nMachine:\sNA\nFixedDate:\s'2000-10-25'\nClosedDate:\s'2000-10-25'\n\n\nName:\nVictor\sWagner\n\nReproducibleScript:\ntclsh8.1\s>testfile\s<<!\n\s\s\s\sfconfigure\sstdout\s-encoding\sunicode\n\s\s\s\sputs\s"\\uFEFFSome\sstuff\n\s\s\s\s!\n\s\s\s\sdd\sif=testfile\sof=testin\sconv=swab\n\s\s\s\stclsh8.1\s<<!\n\s\s\s\sset\sf\s[open\stestin]\n\s\s\s\sfconfigure\s\\$f\s-encoding\sunicode\n\s\s\s\sfconfigure\sstdout\s-encoding\s[encoding\ssystem]\n\s\s\s\sputs\s[read\s\\$f]\n\s\s\s\s!\n\nObservedBehavior:\nWhen\sreading\sutf-16\sfile\sTcl\sdoesn't\srecongize\sbyte\sorder\n\s\s\s\sautomatically.\n\s\s\s\sAccording\sto\sutf-16\sspecification,\seach\sunicode\stext\sfile\sshould\n\s\s\s\scontain\n\s\s\s\s"\\uFEFF"\sas\sfirst\scharacter,\swhich\sallows\sto\sdetermine\sbyte\sorder\n\s\s\s\sautomatically.\n\s\s\s\sBut\sTcl\sdoesn't\spay\sattention\sto\sthis\scharacher.\sSo,\sif\sproper\sUTF-16\n\s\s\s\sfile\sis\sconstructed\son\sMSB-first\smachine\sand\sthen\sread\sby\sTcl\son\n\s\s\s\sLSB-first\n\s\s\s\smachine\sof\svice\sversa,\sit\sdoesn't\sread\sproperly.\sOn\scontrary,\sMS-Word\s97\n\s\s\s\sread\n\s\s\s\ssuch\sfiles\swithout\sproblems\s(at\sleast\sones\swith\sless\sthan\s256\schars)\n\nDesiredBehavior:\nWhen\sreading\sunicode\sfiles,\stcl\sshould\spay\sattention\sto\sfirsh\scharacher\n\s\s\s\sand\sif\sit\sis\sFFFE,\sswitch\sto\sopposite\sbyte\sorder.\n\n\n\n
J foundin obsolete:\s8.1
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 57.\szlib
J title Tcl\sdoesn't\sread\sutf-16\sfiles\sproperly
J type Bug
K 219289ffffffffffffffffffffffffffffffffff
U nobody
Z 8d73b0f8461db6e509c1207b62ca66ee