Skip to content
Tcl Source Code Artifact [2661a33ce4]
Login

Artifact [2661a33ce4]

Artifact 2661a33ce4541f18eba8f4d00e59860e569c54dcb8ad83e138cfa120a987c9f1:

Ticket change [2661a33ce4] - Ticket [0d61d3a2bb905178|0d61d3a2bb] <i>Tcl interprets two adjacent surrogate code points as a character encoded using UTF-16</i> status still Open with 4 other changes by jan.nijtmans on 2021-03-08 09:09:11.
D 2021-03-08T09:09:11.417
J assignee jan.nijtmans
J icomment Can\syou\splease\schange\sthe\sexample:\r\n\r\n<code><verbatim>\r\nset\sstring\s\\u1f91d\r\n</verbatim></code>\r\ninto\r\n<code><verbatim>\r\nset\sstring\s\\U1f91d\r\n</verbatim></code>\r\n\r\nFrom\sthis\sI'm\sassuming\sthis\sbug\sreport\sreferences\s8.7,\ssince\s8.6\sdoesn't\saccept\sthe\s\\U?????-form\syet\sfor\scode\spoints\s>\sU+FFFF.\r\n\r\nTcl\sindeed\sinterprets\ssuch\sescape\ssequences\sas\syou\sdescribe.\sIt's\sa\sfeature,\snot\sa\sbug.\sInternally,\sTcl\sinternally\sstores\sstrings\sin\stwo\spossible\sforms,\sone\sis\s[https://simonsapin.github.io/wtf-8/|WTF-8],\sthe\sother\sone\sis\sUTF-16.\r\nUnicode\sallows\suse\sof\ssuch\sforms\sinternally,\sas\slong\sas\swhen\scommunicating\swith\sthe\soutside\sworld\sit's\stranslated\sinto\scorrect\sUTF-8.\sSince\s8.6.10,\sTcl\sdoes\sthis\scorrectly\swhen\sit\scan\s(when\sit\sconsists\sof\svalid\ssurrogate-pairs)\sbut\sallows\sWTF-8\sforms\sto\sescape\swhen\sthey\scontain\sunpaired\ssurrogates.\r\n\r\nI\swould\slike\sto\sdeprecate\ssuch\susage,\ssee\s[https://core.tcl-lang.org/tips/doc/trunk/tip/573.md|TIP\s#573],\sbut\sI\sdon't\sthink\sthis\swould\sbe\saccepted\sfor\s8.7.\sMaybe\sfor\s9.0,\sbut\s-\sstill\s-\sthis\sTIP\stext\sis\spremature,\sfully\sopen\sfor\sdiscussion.\r\n\r\nFor\s8.x,\syes\sit's\stoo\slate,\ssince\s\\uD83E\\uDD1D\sis\salready\sa\svalid\s(internal)\srepresentation\sfor\s🤝.\sIt's\sthe\sonly\sportable\sway\sto\sdo\sthat\sin\sTcl\s8.6,\sin\sTcl\syou\scan\ssimply\suse\sthe\s🤝\scharacter\sdirectly\s[https://core.tcl-lang.org/tips/doc/trunk/tip/587.md|TIP\s#587]\sor\syou\scan\suse\sthe\s\\U1F91D\sescape\ssequence.\r\n\r\nCan\sI\sclose\sthis\sticket\sas\s"Fixed\sin\s9.0"?\sIf\syou\sfind\ssituations\sin\swhich\sWTF-8\sforms\sescape\s(like\sthe\stwo\srecent\sbugs\sChristian\sWerner\sreported),\splease\sfile\sa\sbug\sreport!\sI'm\snot\sclaiming\sTcl\s8.6/8.7/9.0\sis\sthere\syet\s([https://core.tcl-lang.org/tips/doc/trunk/tip/587.md|TIP\s#575]\sis\sbeing\svoted\son\snow),\sbut\sit's\sgetting\sbetter\sand\sbetter.
J login jan.nijtmans
J mimetype text/x-fossil-wiki
K 0d61d3a2bb905178694d6cde8147039974600274
U jan.nijtmans
Z af9d6a4bbcb57e00454d9bda5f861807