Artifacts Associated With Ticket 493dccc2de
Ticket change [7c3e86aeaf] (rid 182002) by dgp on 2020-04-17 15:22:57:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
Fresh ticket to sort out what we expect from test utf-2.11 with body: string length [testbytestring "\xF4\x90\x80\x80"] According to the normal rules of UTF-8, the test considers the proper 4 byte encoding of the codepoint U+10000 and the test is testing what Tcl does with it. We should expect different version and different configuration builds to give different results. - is_private initialized to: "0"
- login: "dgp"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Important"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "- New Builtin Commands"
- title initialized to: "Taming test utf-2.11"
- type initialized to: "Bug"
Ticket change [91c9b63cb0] (rid 182003) by dgp on 2020-04-17 15:26:33:
- assignee changed to: "dgp"
- login: "dgp"
- mimetype: "text/plain"
- subsystem changed to: "44. UTF-8 Strings"
Ticket change [a8d75c8ba3] (rid 182008) by jan.nijtmans on 2020-04-17 15:37:43:
- icomment:
No, it translates to code point U+110000, which is too big.
- login: "jan.nijtmans"
- mimetype: "text/plain"
- icomment:
Ticket change [af46db5c46] (rid 182009) by dgp on 2020-04-17 15:40:38:
- icomment:
Aha! Misread the lead byte and get the wrong answer. \xF4\x90\x80\x80 ^ would decode to U+110000 which is outside the Unicode range, which is what the test is meant to check the handling of. - login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [d2247384ca] (rid 182010) by dgp on 2020-04-17 15:42:00:
- icomment:
Important lesson, the set of codepoints that can be encoded in a 4-byte sequence is strictly greater than the set of codepoints acceptable in Unicode.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [51111fe6dc] (rid 182011) by dgp on 2020-04-17 16:04:40:
- icomment:
Thanks for your patience. This should be simple to fix with an adaptation of Overlong(). Stay tuned.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [63df3958ac] (rid 182027) by dgp on 2020-04-17 21:08:12:
- icomment:
Fix committed to 8.5. Careful merge work still needed.
- login: "dgp"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Pending"
- icomment:
Ticket change [f4ef2c6d73] (rid 182213) by jan.nijtmans on 2020-04-22 07:45:12:
- icomment:
Since the fix is merged to 8.6, and never existed on 8.7 and 9.0, this ticket can be closed now. Don, agreed!
- login: "jan.nijtmans"
- mimetype: "text/plain"
- icomment:
Ticket change [4ca718a482] (rid 182227) by sebres on 2020-04-22 10:21:35:
- icomment:
As for [b38c307e41], why not both (testsize command and format as fallback) for ucs2 constraint, Jan? I mean:<code><pre> [expr {[llength [info commands testsize]] ? [testsize unichar] == 2 : [format %c 0x010000] eq "\uFFFD" }] </pre></code> Because if tested with compiled test-module, testsize is more "precise" or rather fewer error-prone then, otherwise the tests become "protected" by format expression (at least for 8.5/8.6). - login: "sebres"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [abe26f8161] (rid 182230) by jan.nijtmans on 2020-04-22 12:06:10:
- icomment:
@sebres, Well, "format %c" uses Tcl_UniCharToUtf() to convert the integer to a UTF-8 byte sequence. This function returns the UTF-8 sequence of \xFFFD for out-of range Unicode character values. It does this, even as far back as Tcl 8.4: [https://core.tcl-lang.org/tcl/artifact?udc=1&ln=183-211&name=b972e779b5e039b4] Looks like a perfect feature-test to me, works for any Tcl version in the past, should work for any Tcl version in the future. Your suggestion is harmless, but I don't see the added values. Sorry :-) - login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [e8257216a4] (rid 182231) by sebres on 2020-04-22 13:20:24:
- icomment:
<blockquote><i>> 1. "format %c" uses Tcl_UniCharToUtf() to convert the integer to a UTF-8 byte sequence.<br/> > 2. This function returns the UTF-8 sequence of \xFFFD for out-of range Unicode character values. </i></blockquote> Sure, but either 1 or 2 can change in some version (or derivation). But OK, I understand.<br/> Nevertheless I would at least change it to something more clear and less conditional, like this: <pre> [expr {[scan [format %c 0x010000] %c] != 0x010000}] </pre> - login: "sebres"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [0b1b99edce] (rid 182232) by jan.nijtmans on 2020-04-22 13:38:07:
- icomment:
> Sure, but either 1 or 2 can change in some version (or derivation) Well, Tcl 8.7 will use utf16 in stead of ucs2 for internal storage: $ tclsh8.7 % format %c 0x010000 𐀀 % expr {[format %c 0x010000] eq "\uFFFD"} 0 % expr {[format %c 0x010000] eq "\U010000"} 1 % This means that the "ucs2" 'feature' will be gone when Tcl 8.6 is gone. Long live Tcl 8.7! - login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [49a96d913f] (rid 182233) by jan.nijtmans on 2020-04-22 13:39:39:
- icomment:
Well, Tcl 8.7 will use utf16 in stead of ucs2 for internal storage: <pre> $ tclsh8.7 % format %c 0x010000 𐀀 % expr {[format %c 0x010000] eq "\uFFFD"} 0 % expr {[format %c 0x010000] eq "\U010000"} 1 % </pre> This means that the "ucs2" 'feature' will be gone when Tcl 8.6 is gone. Long live Tcl 8.7! - login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- icomment:
Ticket change [7f511400a7] (rid 182244) by dgp on 2020-04-22 14:58:54:
- icomment:
Ok, the constraint conversation is over here. Here's my comment copied over: The constraint "ucs2" is distinct from "compat85" and needs to be restored. "ucs2" might be a bad name for it. We can change that, but I need a way to directly determine whether (sizeof(Tcl_UniChar) == 2) and nothing else. The "compat85" constraint tests whether Tcl has no way to internally store codepoints > U+FFFF. That is not the same thing. In a default build of Tcl 8.7, the "compat85" constraint should be false, but the "ucs2" constraint should be true.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [70e5dd9e2f] (rid 182245) by dgp on 2020-04-22 15:01:33:
- icomment:
The purpose of the "ucs2" constraint is to permit skipping of tests in builds where the bug [1004065] is not fixed and not made irrelevant by other developments. My hope is that the use of this constraint will be temporary.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [89cfdd0ca2] (rid 182247) by dgp on 2020-04-22 15:24:53:
- icomment:
I like "ucs2" as a better name for what used to be "compat85". Keep that. I'll convert the other constraint to the name "twobyteunit" unless someone else beats me to it.
- login: "dgp"
- mimetype: "text/plain"
- icomment:
Ticket change [3b19b59715] (rid 182310) by jan.nijtmans on 2020-04-23 11:39:18:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2458962.98562514"
- closer changed to: "jan.nijtmans"
- login: "jan.nijtmans"
- mimetype: "text/plain"
- status changed to: "Closed"