.
D 2002-01-21T05:39:59
J assignee andreas_kupries
J cmimetype text/plain
J comment This\shappens\son\stcl8.3.4\s(also\stested\son\s8.3.3)\son\sLinux.\n\nI\shave\sa\schannel\sopen\sfor\swriting\swith\sencoding\niso2022-jp.\sWhen\sI\s"puts"\sa\scertain\sstring\stcl\sgets\nstuck\sin\sa\sloop\sand\sthe\soutput\sfile\sstarts\sgrowing\nindefinitely.\sThe\sproblem\scan\sbe\sdemonstrated\sby\sthe\nfollowing\sscript:\n\nset\sstring\s[format\s%s%c\s[string\srepeat\s"\s"\s4094]\s12399]\nset\sf\s[open\sout\sw\s0644]\nfconfigure\s$f\s-encoding\siso2022-jp\nputs\s-nonewline\s$f\s$string\nclose\s$f\n\nThis\sscript\swill,\swhen\sexecuted,\snever\sget\spast\steh\nputs\sstatement\sand\sthe\soutfile\swill\sstart\sto\sgrow\s(fast:-).\n\nThe\sproblem\slies\sin\sWriteChars\sin\stclIO.c.\sWhen\nTcl_UtfToExternal\sis\scalled\swith\sTCL_ENCODING_START\sset\namong\sthe\sflags,\sthen\sit\swill\salways\sgenerate\sat\sleast\nthree\sbytes\s(assuming\sthe\soutput\sencoding\sis\niso2022-jp).\s\sHowever\sit\sdid\snot\sconsume\sany\sof\sthe\ncharacters\sin\sthe\sinput\sbuffer\s(at\sleast\snot\sif\nTCL_ENCODING_END\sis\sclear).\sBut\sthe\slogic\sin\sWriteChars\nthinks\sthat\ssince\sit\sgenerated\soutput\swe\sshoudl\scall\sit\nagain...\n\nThe\sattached\spatch\sfixes\sthis\sby\sremoving\sthe\nTCL_ENCODING_START\sbit\sfrom\sflags\safter\sthe\sfirst\scall\nto\sTcl_UtfToExternal.\n
J foundin obsolete:\s8.3.3
J priority 5\sMedium
J resolution None
J status Open
J submitter nobody
J subsystem 24.\sChannel\sCommands
J title Trouble\swriting\siso2022-jp
J type Bug
K 506296ffffffffffffffffffffffffffffffffff
U nobody
Z cb07f2df39579f473910e890b49fb7bd