Skip to content
Tcl Source Code Artifact [065ebad0f9]
Login

Artifact [065ebad0f9]

Artifact 065ebad0f95d319444efa6963d5ca743eb83e00030c30e2d059b243f6fd2bfa6:

Ticket change [065ebad0f9] - Pending ticket [31aa44375de2c87e|31aa44375d]: <i>Tcl_NumUtfChars regression in default 8.6 build</i> plus 6 other changes by jan.nijtmans on 2020-04-05 21:00:38.
D 2020-04-05T21:00:38.766
J icomment Well,\sfirst\sremark:\s\sTcl\s9.0\sgives\sthe\sright\sanswere\shere:\r\n\r\n%\slmap\si\s{0\s1\s2\s3\s4}\s{testnumutfchars\s[testbytestring\s\\xf0\\x9f\\x92\\xa9]\s$i}\r\n0\s1\s2\s3\s1\r\n\r\nBut\s...\sfor\sTcl\s8.x,\swe\sconsider\s4-byte\ssequences\sas\sconsisting\son\s2\ssurrogates.\sSo,\sthere\sthe\scorrect\sanswer\sshould\sbe:\r\n\r\n%\slmap\si\s{0\s1\s2\s3\s4}\s{testnumutfchars\s[testbytestring\s\\xf0\\x9f\\x92\\xa9]\s$i}\r\n0\s1\s2\s3\s2\r\n\r\nYou\sare\scorrectly\snoticing\sthat\sTcl_UtfCharComplete()\sdoes\snot\salways\smatch\swith\sTcl_UtfToUniChar:\sSometimes\sonly\s1\sbyte\sis\sdemanded,\sbut\sTcl_UtfToUniChar()\sstill\sreads\s3\sbytes.\sThat's\scorrected\sin\s[166c0270e7812ba4\snow.\sThat\schange\schanges\syour\stest-case\sinto\sthe\sright\sanswer.\r\n\r\nStill,\sthe\sdocumentation\sneeds\sto\sbe\sadapted\sexplaining\swhy\sthis\sis\sthe\sright\sanswer.\sSo,\sI'm\snot\sclosing\sthis\sticket\syet.
J login jan.nijtmans
J mimetype text/plain
J priority 3\sLow
J resolution Fixed
J severity Minor
J status Pending
K 31aa44375de2c87ecb1361b15ca0102d831ad155
U jan.nijtmans
Z 5bea2570310ac4e2975b1042afadc809