Overview
| Artifact ID: | 8b9a866ec239821dcfe7834c1df776fcf0d456116d151ca66f3b476b0a1b8cc8 |
|---|---|
| Ticket: | 0d902eadd659898069ee5f2fb1c4d0764fdfe57a
[string first] cannot assume that Unicode = non-ASCII |
| User & Date: | dkf on 2017-11-04 00:41:45 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/html"
- comment changed to:
The following code: <pre> set s hello; regexp ll $s m; string first $m $s </pre> has a result of <tt>-1</tt>, which is <i>very</i> surprising. The problem is that <tt>regexp</tt> uses <tt>Tcl_GetRange()</tt> on objects with a unicode representation (which <tt>regexp</tt> needs for its own purposes) and that decides that the best thing is to create a <i>pure</i> unicode object, even though the string is within the ASCII range. Normally that wouldn't matter, but <tt>string first</tt> (properly <tt>TclStringFind()</tt>) assumes that that's an impossible situation and jumps merrily to saying that things can't match when that's totally untrue. <p> This was discovered by Pat Thoyts, and narrowed down to changes in the <tt>dgp-string-find<tt> branch.
- foundin changed to: "8.7a1"
- is_private changed to: "0"
- login: "dkf"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "dkf"
- subsystem changed to: "11. Conversions from String"
- title changed to:
[string first] cannot assume that Unicode = non-ASCII
- type changed to: "Bug"