Skip to content
Tcl Source Code Artifact [b64db68593]
Login

Artifact [b64db68593]

Artifact b64db68593e05eb10b5d616c3704be1d8debd2d4af34ab0cb46af1b591b4199a:

Ticket change [b64db68593] - Ticket [c5bcbf349489ed52|c5bcbf3494] <i>Output of surrogates seems to repeat following character</i> status still Open with 3 other changes by apnadkarni on 2023-02-07 07:56:17.
D 2023-02-07T07:56:17.772
J icomment It's\scertainly\spossible\sit's\splatform\sor\sconsole\sdependent.\sHowever\sconsider\sthe\sfollowing\scode\swhich\shints\sat\sdependency\son\sthe\sencoding\sused\sby\sthe\schannel\sdriver.\r\n\r\n```\r\n%\sputs\sA\\uD800B\r\nABB\r\n%\sputs\s[regexp\s-inline\s.*\sA\\uD800B]\r\nerror\swriting\s"stdout":\sillegal\sbyte\ssequence\r\n```\r\n\r\nThe\sregexp\soutput\sshould\sbe\ssame\sas\sits\sarg.\sWhy\sthe\sdifference\sin\sresult?\sFurther\sinvestigating,\r\n\r\n```\r\n%\sstring\sequal\sA\\uD800B\s[regexp\s-inline\s.*\sA\\uD800B]\r\n0\r\n%\scodepoints\sA\\uD800B\r\nU+00000041\sU+0000D800\sU+00000042\r\n%\scodepoints\s[regexp\s-inline\s.*\sA\\uD800B]\r\nU+00000041\sU+000000F0\sU+00000042\r\n```\r\n\r\nSo\sit\sseems\sthere\sis\sclearly\sa\sissue\sthere.\sNote\s9.0\scorrectly\sshows\sthe\stwo\sstrings\sas\sequal.\r\n\r\nIt's\spossible\sthis\sis\salso\sa\sresult\sof\sthe\sTcl_UnicharToUtf\s(or\swas\sit\sTcl_UtfToUnichar?)\sbug\syou\smentioned\sin\sthe\sother\sticket\sbut\ssomething\ssmells\soff.\r\n\r\nFurther,\sI'm\ssurprised\sthat\sthe\sputs\sraises\sand\serror\seven\sthough\s-nocomplainencoding\sis\s1\s(default\sfor\sTcl8)\r\n\r\n```\r\n%\sfconfigure\sstdout\r\n-blocking\s1\s-buffering\sline\s-buffersize\s4096\s-encoding\sutf-16\s-eofchar\s{}\s-nocomplainencoding\s1\s-strictencoding\s0\s-translation\scrlf\s-winsize\s{120\s30}\r\n%\sputs\s[regexp\s-inline\s.*\sA\\uD800B]\r\nerror\swriting\s"stdout":\sillegal\sbyte\ssequence\r\n```\r\n\r\nAs\san\saside,\sI'm\shaving\sa\sbit\sof\shard\stime\swith\stest\scases\sbecause\swhen\sresults\sare\snot\sas\sexpected,\sthe\sputs\sthat\sprints\sthe\sresult\sraises\san\sexception\sas\sabove\sand\sthe\sentire\stest\srun\saborts\son\sa\sfailure\sto\sprint\sto\sstdout.\sThat's\sa\sseparate\sissue\sthough\sthat\sI'm\sfixing\sin\stcltest.\r\n\r\n/Ashok
J login apnadkarni
J mimetype text/x-markdown
K c5bcbf349489ed5260b2fd21a3d9f7a195d82585
U apnadkarni
Z bc96987ebedc6885421276d2b5d3d573