Artifacts Associated With Ticket 1236896fffffffff
Ticket change [762474e58d] (rid 105521) by rmax on 2005-07-12 18:40:41:
- assignee initialized to: "nijtmans"
- cmimetype initialized to: "text/plain"
- comment initialized to:
This patch introduces a Tcl_UtfNcasecmp() function and uses it as a replacement for strcasecmp in [lsearch], [lsort], and [switch], when the -nocase option is given. "make genstubs" is needed after applying the patch. A TIP for this still has to be written.
- foundin initialized to: "None"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "rmax"
- subsystem initialized to: "44. UTF-8 Strings"
- title initialized to:
make -nocase behave correct with non-ASCII characters
- type initialized to: "Patch"
Ticket change [0d94513b69] (rid 114390) by rmax on 2005-07-13 01:40:41:
- icomment:
File Added - 141834: Tcl_Utfcasecmp.patch
- login: "rmax"
- mimetype: "text/plain"
- username: "rmax"
- icomment:
Add attachment "Tcl_Utfcasecmp.patch" [515f49397f] (rid 126132) by rmax on 2005-07-13 01:40:41.
Ticket change [b063edf44d] (rid 97974) by dkf on 2005-07-13 15:20:12:
- assignee changed to: "dkf"
- icomment:
Logged In: YES user_id=79902 We could try doing this in two stages. Stage #1: Define a TclUtfNCaseCmp function (or something similar) that is *not* in any stubs table, but which is used to fix the guts of the various Tcl commands listed. This part can be done now. Stage #2: Change the name of the function to something exported and put it in the stubs table. This is the stage that needs documentation work and a TIP.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
Ticket change [55ce46f622] (rid 94212) by rmax on 2005-07-13 15:35:05:
- icomment:
Logged In: YES user_id=124643 Whoops, there is a typo in my initial comment: Tcl_UtfNcasecmp() already exists, and my patch adds a Tcl_Utfcasecmp() function (without "N").
- login: "rmax"
- mimetype: "text/plain"
- username: "rmax"
- icomment:
Add attachment "Tcl_Utfcasecmp.patch" [637011273d] (rid 92576) by rmax on 2005-07-13 20:57:43.
Ticket change [1bc971219d] (rid 123206) by rmax on 2005-07-13 20:57:43:
- icomment:
File Added - 141929: Tcl_Utfcasecmp.patch Logged In: YES user_id=124643 I am uploading a revised version of the patch that changes the name of the new API to Tcl_UtfCasecmp and removes a misleading comment that was a copy-n-paste oversight. Meanwhile I timed [lsort -nocase] and found it to take about twice as long after adding this patch.
- login: "rmax"
- mimetype: "text/plain"
- username: "rmax"
- icomment:
Ticket change [45ba8c6485] (rid 99397) by dgp on 2005-07-14 05:02:52:
- icomment:
Logged In: YES user_id=80530 the new test cmdIL-5.6 has values I assume are in the utf-8 encoding. Since the *.test files get [source]d in [encoding system], that's not really portable. Would be better to use \uHHHH backslash substitution to construct the test strings and results.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [e29b5f2da4] (rid 87660) by dgp on 2005-07-14 05:07:16:
- icomment:
Logged In: YES user_id=80530 otherwise this looks ok. I agree with dkf that a two-stage implementation is the way to go. Get the fix in immediately. Make it public as approved.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [4f43d809a3] (rid 125798) by mistachkin on 2005-07-14 14:42:00:
- icomment:
Logged In: YES user_id=113501 Why does [lsort -nocase] take twice as long with this patch?
- login: "mistachkin"
- mimetype: "text/plain"
- username: "mistachkin"
- icomment:
Ticket change [5940ac84a8] (rid 117947) by dkf on 2005-07-14 15:16:07:
- icomment:
Logged In: YES user_id=79902 'cos usually strcasecmp() assumes one-byte-per-char and probably ISO8859-* so case conversion can be done very quickly. The updated version has to de-UTF8 each character before case conversion.
- login: "dkf"
- mimetype: "text/plain"
- username: "dkf"
- icomment:
Ticket change [3841d1048c] (rid 112165) by rmax on 2005-07-14 15:21:27:
- icomment:
Logged In: YES user_id=124643 Look at the implementation of Tcl_UtfCasecmp. It has to do much more work than strcasecmp does to give correct results for non-ASCII characters.
- login: "rmax"
- mimetype: "text/plain"
- username: "rmax"
- icomment:
Ticket change [0594913814] (rid 89088) by rmax on 2005-07-15 02:16:35:
- icomment:
Logged In: YES user_id=124643 The new version of the patch does special-casing for ASCII characters. It makes [lsearch] only slightly slower on lists of pure ASCII strings, and also improves performance for strings that contain a mix of ASCII and other characters. It also renames follows dkf's advice and makes the function private so that it can be applied without a TIP.
- login: "rmax"
- mimetype: "text/plain"
- username: "rmax"
- icomment:
Ticket change [af11f495ff] (rid 97744) by rmax on 2005-07-15 02:16:37:
- icomment:
File Added - 142083: TclUtfcasecmp-3.patch
- login: "rmax"
- mimetype: "text/plain"
- username: "rmax"
- icomment:
Add attachment "TclUtfcasecmp-3.patch" [1ae97e0f97] (rid 123056) by rmax on 2005-07-15 02:16:37.
Ticket change [f4d9ebe987] (rid 129997) by dgp on 2005-07-15 03:08:05:
- icomment:
Logged In: YES user_id=80530 It looks like the latest patch doesn't limit its case-equivalencies to alphabetic characters. For example, the characters '[' (\x5b) and '{' (\x7b) get treated as -nocase equivalents because they are the same with the 0x20 bit forced set. - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [3a7bcab129] (rid 112570) by dgp on 2005-07-15 03:15:31:
- icomment:
Logged In: YES user_id=80530 demo session: % lsort -nocase {@ `} @ ` % lsort -nocase {` @} ` @ - login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [c7896aeed1] (rid 121946) by rmax on 2005-07-15 05:21:39:
- icomment:
Logged In: YES user_id=124643 OK, so this time it should really be correct, as I have verified that TclUtfCasecmp produces exactly the same results as strcasecmp for any combination of characters between 0x01 and 0x7f, inclusive. I've also added dgp's demo to the test suite. I haven't yet timed this version, as I wrote it at home and the code I used for the performance comparision is at work. I'll do that tomorrow morning and report the results here.
- login: "rmax"
- mimetype: "text/plain"
- username: "rmax"
- icomment:
Add attachment "TclUtfCasecmp-4.patch" [f095269521] (rid 109214) by rmax on 2005-07-15 05:21:40.
Ticket change [db0f9a196e] (rid 107893) by rmax on 2005-07-15 05:21:46:
- icomment:
File Added - 142100: TclUtfCasecmp-4.patch
- login: "rmax"
- mimetype: "text/plain"
- username: "rmax"
- icomment:
Ticket change [5aaea0309a] (rid 118185) by dgp on 2005-07-18 21:46:04:
- icomment:
Logged In: YES user_id=80530 Here's an alternative patch. Please check its performance against the earlier patch.
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Add attachment "1236896.patch" [4db28c9d8d] (rid 127092) by dgp on 2005-07-18 21:46:05.
Ticket change [fe1db40c92] (rid 108526) by dgp on 2005-07-18 21:46:06:
- icomment:
File Added - 142444: 1236896.patch
- login: "dgp"
- mimetype: "text/plain"
- username: "dgp"
- icomment:
Ticket change [e86f603f85] (rid 104643) by rmax on 2005-07-19 00:45:19:
- icomment:
Logged In: YES user_id=124643 This is the fastest version I've been able to come up with. The patch now adds the same ASCII optimisations to Tcl_UtfNcmp and Tcl_UtfNcasecmp.
- login: "rmax"
- mimetype: "text/plain"
- username: "rmax"
- icomment:
Ticket change [ad51c286de] (rid 101451) by rmax on 2005-07-19 00:45:20:
- icomment:
File Added - 142464: TclUtfCasecmp-10.patch
- login: "rmax"
- mimetype: "text/plain"
- username: "rmax"
- icomment:
Add attachment "TclUtfCasecmp-10.patch" [c56b30b1ab] (rid 112001) by rmax on 2005-07-19 00:45:20.
Ticket change [37f1406ebc] (rid 112118) by jenglish on 2008-02-29 04:48:36:
- icomment:
Logged In: YES user_id=68433 Originator: NO See also #1902648. This is a portability problem as well as a correctness problem.
- login: "jenglish"
- mimetype: "text/plain"
- username: "jenglish"
- icomment:
Ticket change [1414850c0c] (rid 132610) by jan.nijtmans on 2013-07-03 11:12:52:
- closer changed to: "nobody"
- comment changed to:
This patch introduces a Tcl_UtfNcasecmp() function and uses it as a replacement for strcasecmp in [lsearch], [lsort], and [switch], when the -nocase option is given. "make genstubs" is needed after applying the patch. A TIP for this still has to be written.
- icomment:
Dup of [3613609] Still want to write a TIP to put this function in the (public) stubs?
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- severity changed to: "Minor"
- status changed to: "Pending"
Ticket change [bbe86424b3] (rid 135571) by dkf on 2013-11-12 14:41:00:
- closedate changed to: "2456609.11181262"
- closer changed to: "dkf"
- login: "dkf"
- mimetype: "text/plain"
- status changed to: "Closed"