.
D 2017-11-04T00:41:45.543
J assignee nobody
J closer nobody
J cmimetype text/html
J comment The\sfollowing\scode:\r\n<pre>\r\nset\ss\shello;\sregexp\sll\s$s\sm;\sstring\sfirst\s$m\s$s\r\n</pre>\r\nhas\sa\sresult\sof\s<tt>-1</tt>,\swhich\sis\s<i>very</i>\ssurprising.\sThe\sproblem\sis\sthat\s<tt>regexp</tt>\suses\s<tt>Tcl_GetRange()</tt>\son\sobjects\swith\sa\sunicode\srepresentation\s(which\s<tt>regexp</tt>\sneeds\sfor\sits\sown\spurposes)\sand\sthat\sdecides\sthat\sthe\sbest\sthing\sis\sto\screate\sa\s<i>pure</i>\sunicode\sobject,\seven\sthough\sthe\sstring\sis\swithin\sthe\sASCII\srange.\sNormally\sthat\swouldn't\smatter,\sbut\s<tt>string\sfirst</tt>\s(properly\s<tt>TclStringFind()</tt>)\sassumes\sthat\sthat's\san\simpossible\ssituation\sand\sjumps\smerrily\sto\ssaying\sthat\sthings\scan't\smatch\swhen\sthat's\stotally\suntrue.\r\n<p>\r\nThis\swas\sdiscovered\sby\sPat\sThoyts,\sand\snarrowed\sdown\sto\schanges\sin\sthe\s<tt>dgp-string-find<tt>\sbranch.
J foundin 8.7a1
J is_private 0
J login dkf
J priority 5\sMedium
J resolution None
J severity Important
J status Open
J submitter dkf
J subsystem 11.\sConversions\sfrom\sString
J title [string\sfirst]\scannot\sassume\sthat\sUnicode\s=\snon-ASCII
J type Bug
K 0d902eadd659898069ee5f2fb1c4d0764fdfe57a
U dkf
Z 835a00134b40191ed35e715150988d68