Skip to content
Tcl Source Code History Of Ticket 493dccc2de
Login

History Of Ticket 493dccc2de

Artifacts Associated With Ticket 493dccc2de

  1. Ticket change [7c3e86aeaf] (rid 182002) by dgp on 2020-04-17 15:22:57:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. 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.
      
    5. is_private initialized to: "0"
    6. login: "dgp"
    7. priority initialized to: "5 Medium"
    8. resolution initialized to: "None"
    9. severity initialized to: "Important"
    10. status initialized to: "Open"
    11. submitter initialized to: "dgp"
    12. subsystem initialized to: "- New Builtin Commands"
    13. title initialized to: "Taming test utf-2.11"
    14. type initialized to: "Bug"
  2. Ticket change [91c9b63cb0] (rid 182003) by dgp on 2020-04-17 15:26:33:

    1. assignee changed to: "dgp"
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. subsystem changed to: "44. UTF-8 Strings"
  3. Ticket change [a8d75c8ba3] (rid 182008) by jan.nijtmans on 2020-04-17 15:37:43:

    1. icomment:
      No, it translates to code point U+110000, which is too big.
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
  4. Ticket change [af46db5c46] (rid 182009) by dgp on 2020-04-17 15:40:38:

    1. 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.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  5. Ticket change [d2247384ca] (rid 182010) by dgp on 2020-04-17 15:42:00:

    1. 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.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  6. Ticket change [51111fe6dc] (rid 182011) by dgp on 2020-04-17 16:04:40:

    1. icomment:
      
      Thanks for your patience. This should be simple to fix with
      an adaptation of Overlong(). Stay tuned.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  7. Ticket change [63df3958ac] (rid 182027) by dgp on 2020-04-17 21:08:12:

    1. icomment:
      
      Fix committed to 8.5.  Careful merge work still needed.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
    4. resolution changed to: "Fixed"
    5. status changed to: "Pending"
  8. Ticket change [f4ef2c6d73] (rid 182213) by jan.nijtmans on 2020-04-22 07:45:12:

    1. 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!
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/plain"
  9. Ticket change [4ca718a482] (rid 182227) by sebres on 2020-04-22 10:21:35:

    1. 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).
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  10. Ticket change [abe26f8161] (rid 182230) by jan.nijtmans on 2020-04-22 12:06:10:

    1. 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 :-)
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  11. Ticket change [e8257216a4] (rid 182231) by sebres on 2020-04-22 13:20:24:

    1. 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>
      
    2. login: "sebres"
    3. mimetype: "text/x-fossil-wiki"
  12. Ticket change [0b1b99edce] (rid 182232) by jan.nijtmans on 2020-04-22 13:38:07:

    1. 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!
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  13. Ticket change [49a96d913f] (rid 182233) by jan.nijtmans on 2020-04-22 13:39:39:

    1. 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!
      
    2. login: "jan.nijtmans"
    3. mimetype: "text/x-fossil-wiki"
  14. Ticket change [7f511400a7] (rid 182244) by dgp on 2020-04-22 14:58:54:

    1. 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.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  15. Ticket change [70e5dd9e2f] (rid 182245) by dgp on 2020-04-22 15:01:33:

    1. 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.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  16. Ticket change [89cfdd0ca2] (rid 182247) by dgp on 2020-04-22 15:24:53:

    1. 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.
      
    2. login: "dgp"
    3. mimetype: "text/plain"
  17. Ticket change [3b19b59715] (rid 182310) by jan.nijtmans on 2020-04-23 11:39:18:

    1. assignee changed to: "jan.nijtmans"
    2. closedate changed to: "2458962.98562514"
    3. closer changed to: "jan.nijtmans"
    4. login: "jan.nijtmans"
    5. mimetype: "text/plain"
    6. status changed to: "Closed"