Artifacts Associated With Ticket 4c591fa4875b64fe
Ticket change [01eaa1f7e8] (rid 182889) by dgp on 2020-04-30 19:30:11:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
% set one \uFFFF % set two \U10000 𐀀 % string compare $one $two -1 % string range $one 0 0 % string range $two 0 0 𐀀 % string compare $one $two 1
- foundin initialized to: "8.7"
- is_private initialized to: "0"
- login: "dgp"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Severe"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "10. Objects"
- title initialized to: "[string compare] EIAS violation"
- type initialized to: "Bug"
Ticket change [c198807f46] (rid 182890) by dgp on 2020-04-30 19:43:19:
- icomment:
% set one \uFFFF; tcl::unsupported::representation $one value is a pure string with a refcount of 4, object pointer at 0xe092870, string representation "" % set two \U10000; tcl::unsupported::representation $two value is a pure string with a refcount of 4, object pointer at 0xe08e8b0, string representation "𐀀" % string compare $one $two -1 % string range $one 0 0; tcl::unsupported::representation $one value is a string with a refcount of 2, object pointer at 0xe092870, internal representation 0xe0c9090:0x0, string representation "" % string range $two 0 0; tcl::unsupported::representation $two value is a string with a refcount of 2, object pointer at 0xe08e8b0, internal representation 0xd81a350:0x0, string representation "𐀀" % string compare $one $two 1 The comparison routines TclpUtfNcmp2() and (deprecated) Tcl_UniCharNcmp() do not agree.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [a5f8c21c9e] (rid 182903) by dgp on 2020-04-30 21:54:19:
- icomment:
The simplest approach would be to eliminate the internal calls to the deprecated routine Tcl_UniCharNcmp(). Then all compares would route through the same routine and get consistent results. Two problems with that. 1) The "Unicode" internal rep was invented because performance of some tasks was impossibly terrible without it. We risk bringing that back. 2) We end up with a [string compare -length ] command that counts its lengths by characters while things like [string length] still count by UTF-16 units which make combining these commands correctly quite tricky. Once we open this door even a little bit, I think we will not be happy until all lengths and indexing operate on characters and not code units.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [1e6368e43c] (rid 192406) by jan.nijtmans on 2021-03-10 15:50:08:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2459284.15981734"
- closer changed to: "jan.nijtmans"
- icomment:
Fixed in all branches now. Thanks, Don, for discovering this!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"