Skip to content
Tcl Source Code History Of Ticket 6474fbd934
Login

History Of Ticket 6474fbd934

Artifacts Associated With Ticket 6474fbd934

  1. Ticket change [1ed05bb442] (rid 197068) by petasis on 2022-01-14 09:05:51:

    1. assignee initialized to: "nobody"
    2. closer initialized to: "nobody"
    3. cmimetype initialized to: "text/plain"
    4. comment initialized to:
      Hi all,
      
      I observe a difference in converting strings to utf-8 between Tcl 8.6/8.7a1 and 8.7a5.
      
      In Tcl 8.6 I get:
      
      binary scan [encoding convertto utf-8 \uD800] H* hex; puts $hex
      > efbfbd
      
      which seems the correct utf-8 encoding.
      
      However, in Tcl 8.7a5 I get:
      
      binary scan [encoding convertto utf-8 \uD800] H* hex; puts $hex
      > eda080
      
      What is the reason for this difference? Shouldn't the utf-8 bytes be the same, no matter what internal representation for strings is used by Tcl?
      
      I know that this is invalid input (and only half of a "character"), but in my view what tcl 8.6 returns makes much more sense, as there is a (very) limited usage. The behaviour in 8.7 returns a character, hiding the problem in the input...
      
      George
      
    5. foundin initialized to: "8.7a5"
    6. is_private initialized to: "0"
    7. login: "petasis"
    8. priority initialized to: "5 Medium"
    9. private_contact initialized to: "3cb4dabca0e1e7b9d560b2ca060abb67f2a97f23"
    10. resolution initialized to: "None"
    11. severity initialized to: "Minor"
    12. status initialized to: "Open"
    13. submitter initialized to: "petasis"
    14. subsystem initialized to: "44. UTF-8 Strings"
    15. title initialized to: "Tcl 8.7a5: why utf-8 is different?"
    16. type initialized to: "Bug"
  2. Ticket change [7de032bd99] (rid 197089) by jan.nijtmans on 2022-01-14 22:39:45:

    1. assignee changed to: "jan.nijtmans"
    2. icomment:
      Proposed fix [c4a89ec75de1ded1|here].
      
      This was - indeed - an early attempt to solve a problem in Tcl, which could cause Tcl to generate invalid UTF-8. Since then, a new idea to solve this arised: [https://core.tcl-lang.org/tips/doc/trunk/tip/601.md|TIP #601]. So I agree to revert this to the Tcl 8.6 behavior. Starting with Tcl 9.0, this situation should (IMHO) throw an exception (by default).
      
    3. login: "jan.nijtmans"
    4. mimetype: "text/x-fossil-wiki"
    5. resolution changed to: "Fixed"
    6. status changed to: "Pending"
  3. Ticket change [0a20eddb96] (rid 197104) by jan.nijtmans on 2022-01-16 09:46:38:

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