Overview
| Artifact ID: | c3d86ff8cb7081f6576b077255293166aef536ef17f0c952a534c2cd50928912 |
|---|---|
| Ticket: | 4e38c347a4ff74fb800262925b0e0994c99ef28d
Changed contract for Tcl_UtfN(case)cmp in Tcl 8.7 |
| User & Date: | jan.nijtmans on 2024-01-09 23:22:29 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
The functions Tcl_UtfN(case)cmp in Tcl 8.6 expect the "n" parameter to count in UTF-16 units, but in 8.7/9.0 those functions count in UTF-32. As long as the string doesn't contain codepoints > U+FFFF this won't be noticed, but it's not correct. Example code from tcldom (domxslt.c line 2312-2315): <pre> lenA = Tcl_NumUtfChars (strA, -1); lenB = Tcl_NumUtfChars (strB, -1); len = (lenA < lenB ? lenA : lenB); rc = Tcl_UtfNcasecmp (strA, strB, len); </pre> There's nothing wrong with this code but if Tcl_UtfNcasecmp() doesn't use the same "len" metrics as Tcl_NumUtfChars() this won't work as expected. Solution: Move Tcl_UtfN(case)cmp to new stub entries, and put back the original Tcl 8.6 versions of those functions. That restores full binary compatibility between 8.6 and 8.7 - foundin changed to: "8.7"
- is_private changed to: "0"
- login: "jan.nijtmans"
- priority changed to: "5 Medium"
- private_contact changed to: "0c50e5320704d174412e57b873d8932de15303e0"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "jan.nijtmans"
- subsystem changed to: "44. UTF-8 Strings"
- title changed to: "Changed contract for Tcl_UtfN(case)cmp in Tcl 8.7"
- type changed to: "Bug"