Skip to content
Tcl Source Code Artifact [e1ac8520fc]
Login

Artifact [e1ac8520fc]

Artifact e1ac8520fc00322b9305d00e48555b781f674d9ea836fb4fa4517a12b94dcbf7:

Ticket change [e1ac8520fc] - Ticket [0306a5563c65ab14|0306a5563c] <i>Writing large strings to file create wrong results</i> status still Open with 3 other changes by pointsman on 2023-04-23 23:57:41.
D 2023-04-23T23:57:41.979
J icomment [Sorry\sagain.\sWhile\snot\scompletely\swrong\sat\sthe\sprevious\splace\sit\sbelongs\sto\shere.]\r\n\r\nThe\sfix\sfor[3d01d51bc4]\swith\scommit\s[186e4d9317]\sdidn't\sreally\sfix\sthe\sproblem.\r\n\r\nLook\sat\s\r\n[https://core.tcl-lang.org/tcl/artifact?udc=1&ln=4262-4278&name=ce11265346dd36a3]\r\n\r\nIn\sthat\sloop\sthe\sscr\spointer\swill\snot\sbe\sincrementend.\sWhich\smeans\sthat\safter\severy\sINT_MAX\sbytes\swritten\sit\sstarts\sover\sfrom\sthe\sstart\sof\sthe\sstring\sinstead\sof\scontinuing.\sThis\sexplains\sthe\soutput\sof\sthe\sexamples\sgiven\sso\sfar.\r\n\r\nAn\sobvious\sfix\sis\r\n\r\nhttps://core.tcl-lang.org/tcl/artifact?udc=1&ln=4276&name=abf0f8ddf7519a1f\r\n\r\nwith\swhich\sall\sthe\sso\sfar\sgiven\sexamples\srun\sas\sexpected.\r\n\r\nBut\sthis\sraises\sthe\squestion\swhat\sWriteChars(chanPtr,\ssrc,\schunkSize)\sdoes\sif\sthe\schunkSize\sends\sin\sthe\smiddle\sof\sa\smultibyte\schar?\r\n\r\nSome\sanswers\sto\sthat\squestion\sdoesn't\slook\spromissing\s(need\sa\sTcl\s9\stcltest\sto\srun\sthis\sexample\sscript):\r\n\r\nset\ss\s[testbigdata\sstring\s0x7FFFFFFE]\r\n#\sThe\scharacter\sto\sappend\sin\sthe\snext\sline\sis\sEM\sDASH,\s\r\n#\scode\spoint\s0x2014\s(decimal\s8212,\sUTF-8\s#xE2\s#x80\s#x94,\s\r\nappend\ss\s—\r\nset\sfd\s[open\sout.txt\sw+]\r\nputs\s$fd\s$s\r\nclose\s$fd\r\n\r\nIf\sI\srun\sthis\s(on\sdebian)\sI\sget:\r\n\r\nerror\swriting\s"file6":\sinvalid\sor\sincomplete\smultibyte\sor\swide\scharacter\r\n\s\s\s\swhile\sexecuting\r\n"puts\s$fd\s$s"
J login pointsman
J mimetype text/x-fossil-plain
K 0306a5563c65ab14410c426f59f00d714bf276fc
U pointsman
Z 954139df70f96c129baa715ee95f0941