<i>Tcl interprets two adjacent surrogate code points as a character encoded using UTF-16</i> status still Open with 3 other changes
by
.
D 2021-03-09T17:00:05.520
J icomment \r\nThis\sis\sa\sdispute\sover\sthe\salphabet\sof\sTcl's\svalue\sset.\s\sJan\sis\scorrect\r\nto\spoint\sto\sTIP\s573\sas\sthe\skey\sissue.\r\n\r\nAll\sTcl\svalues\shave\salways\sbeen\s(conceptually)\s"strings",\sbut\sthe\sprecise\sdefinition\sof\swhat\sis\sa\s"string"\shas\svaried\swith\stime/release.\s\sThe\slast\r\nlarge\srevolution\sin\sTcl's\sstring\svalue\sdefinition\swas\sthe\s8.0\s->\s8.1\r\ntransition.\s\sIn\s8.0\sa\s"string"\swas\sa\ssequence\sof\szero\sor\smore\sbytes.\r\nIn\s8.1,\sa\s"string"\sbecame\sa\ssequence\sof\szero\sor\smore\sUCS-2\svalues,\swhich\r\nour\sdocumentation\sand\sother\swritings\scall\s"characters".\r\n\r\nThe\smigration\splan\sfor\sTcl\s9\sthat\sJan\shas\sdeveloped\sappears\sto\saim\sfor\r\na\sTcl\s9\sdefinition\sof\s"string"\sas\s"a\sproper\sUnicode\sstring".\s\sThis\simplies\r\nthe\sexclusion\sof\svalues\sthat\sare\snot\svalid\sUnicode.\s\sThe\sUnicode\salphabet\r\ndoes\snot\sinclude\sthe\ssurrogate\scodepoints.\s\sThey\scannot\sbe\sincluded\sin\sany\r\nvalid\sUnicode\sstring,\sso\son\sthis\splan\sthey\smust\sno\slonger\sbe\sin\sthe\sTcl\r\nvalue\salphabet.\s\sConsequently\sall\sthe\sexisting\stools\sthat\scould\screate\sor\r\nmanipulate\sthese\svalues\sin\searlier\sreleases\shave\sto\sincompatibly\schange,\r\nand\sthere's\sa\sdisruption\sfor\sdevelopers\sthat\shas\sto\sbe\smanaged.\r\n\r\nOne\sfactor\sin\sfavor\sof\sa\sgoal\sto\shave\sthe\sTcl\s9\svalue\r\nset\sbe\sproper\sUnicode\sstrings\sis\sthat\sit\smoves\sTcl\smore\sin\sthe\sdirection\sof\r\nusing\sstandard\scomponents\sand\stools\sand\snames\sand\saway\sfrom\sits\sfrequent\s(bad?)\r\nhabit\sof\sinventing\sits\sown\sweird\salternatives.\s\sThat\shas\sthe\spotential\sto\r\nmake\sTcl's\scode\sbase\smarginally\smore\sattractive\sto\sexperienced\scoders.\r\n\r\nI\sthink\sthere\sare\stwo\scategories\sof\sreasonable\scriticism.\s\sFirst,\sfor\sthe\sfirst\r\ntime\sthe\sTcl\svalue\sset\sis\sgetting\sreduced.\s\sThere\sare\svalues\sthat\swere\sonce\r\nvalid\sin\sTcl\sthat\sno\slonger\swill\sbe.\s\sThis\sreduces\sthe\sset\sof\sprograms\sthat\r\ncan\sbe\swritten,\sor\seasily\swritten.\s\sManipulation\sof\sarbitrary\sUCS-2\r\nsequences\sin\sa\sTcl\sscript\sbecomes\ssomething\sunnatural\sin\sa\slanguage\sthat\s\r\nrefuses\sto\sdirectly\srepresent\sthose\svalues.\s\sThis\smeans\swriting\sa\sTcl\sscript\r\nthat\sdoes\sUTF-16\sencoding/decoding\sis\ssomething\sthat\shas\sno\simplementation\r\nthat\srests\seasily\son\sthe\scapabilities\sof\sthe\slanguage.\s\sIt\scan\sstill\sbe\r\naccomplished\swith\ssuitable\suse\sof\s[binary\sformat|scan\st*]\s(and\sthe\r\ninefficiencies\sinherent\sin\sthat),\sbut\sthat's\snot\sthe\smost\ssatisfying\sanswer\r\nto\smany\sprogrammers.\s\sIt's\sa\stask\swhere\sthe\slanguage\shas\sto\sbe\sworked\saround\srather\sthan\sused.\sFrom\sthis\sperspective,\sthe\sgoal\sitself\sis\sflawed,\sand\r\nwe\sshould\schange\scourse\sand\saim\sto\shave\sthe\sTcl\s9\sdefinition\sof\sTcl\sstrings\r\nsomehow\scontinue\sto\sbe\sa\ssuperset\sof\sthe\sset\sof\sall\sUCS-2\ssequences,\sand\swe\r\nshould\sretain\sall\sthe\stools\swe\shave\sto\soperate\son\ssuch\svalues.\r\n\r\nThe\ssecond\scategory\sof\sreasonable\scriticism\sis\sthat\sthe\sTcl\s9\sgoal\sto\r\ndefine\sproper\sUnicode\sstrings\sas\sTcl's\svalue\sset\sis\sacceptable,\sbut\sthat\r\nthe\scurrent\smigration\spath\sto\sget\sthere\sis\sbumpier\sthan\sit\sought\sto\sbe.\r\nIn\sthat\srealm,\sthe\smore\sspecific\sthe\scomplaint,\sand\sthe\soffering\sof\r\nalternatives\sis\sthe\sbest\sway\sforward.\s\sAlso,\sin\sthis\srealm,\sthe\smost\suseful\r\nvenue\sfor\shashing\sout\sthe\sissues\swould\sbe\sthe\sproduction\sof\smigration\sguides\r\nfor\sTcl\sprogrammers.\s\sForcing\sourselves\sinto\sthe\steaching\srole\sshould\sforce\r\nus\sto\suncover\sjust\swhere\sthe\srough\sedges\sare,\sand\swhether\sthey\scan\sbe\ssanded\r\ndown,\sor\swhether\sany\sare\sdeal-breakers.\r\n\r\nI\stend\sto\sagree\swith\sthe\sfirst\scriticism.\s\sFrom\spooryorick's\ssubmission\r\nI\sthink\she\sdoes\stoo.\s\sJan\shas\sdone\sthe\swork,\sthough.\s\sHe's\sheld\sthe\sTIP\r\nvotes\sand\sgot\sthe\srequisite\sapprovals.\s\sTcl\s8.7\sbehaves\sthe\sway\sit\sdoes\r\n(mostly,\smodulo\ssome\serrors\salong\sthe\sway)\sbecause\sthe\sTCT\saccepted\sthe\r\nchanges.\s\sPerhaps\ssome\sof\sthe\sTCT\ssupporters\sof\sthis\spath\shave\snot\sbeen\r\nfully\saware\sof\sthese\sissues\sof\sdisruption\sand\r\nrepresentation,\sand\sit\smight\sbe\sworthwhile\sto\sraise\sdiscussions\son\sTCLCORE,\r\nbut\sI\sthink\sthat's\sthe\sbetter\svenue\sfor\sconfronting\sthe\sdispute\sat\sthis\spoint\r\nthan\sa\sticket\sasserting\sa\sbug.\s\sFor\smyself,\sI've\staken\sthe\sattitude\sfor\ssome\r\ntime\snow\sthat\sno\smatter\smy\sreservations\sand\sdistaste,\sif\sI\scannot\sdeliver\sa\r\nbetter\salternative,\sthere's\slittle\svalue\sin\sbeing\sno\smore\sthan\sa\snaysayer.\r\n\r\nPooryorick,\sif\syou\swant\sto\spursue\sanother\sapproach,\sI'm\swilling\sto\shelp\r\nwhere\sand\sas\sI\scan.\r\n\r\nI\shope\sthat's\sfair\sto\severyone.
J login dgp
J mimetype text/plain
K 0d61d3a2bb905178694d6cde8147039974600274
U dgp
Z fe824c9a6168423715ee4fc905f3140a