Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: a5247a0e52317a317d636f97f856f0bc7def9b986df1ffecde42ca56c9ee79aa
Ticket: f443140a8547b6f6d70c51a6bbf742e72dca0ca8
connection between Tcl_UtfNext/Tcl_UtfPrev and Tcl_UtfCharComplete()
User & Date: jan.nijtmans on 2020-04-27 16:48:09
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-fossil-wiki"
  4. comment changed to:
    When hunting for [27944a3661], it has ben apparent that some people expect that Tcl_UtfCharComplete() can be used to protect Tcl_UtfNext() calls for overflowing
    when the string is not 0-terminated. This has always been true, but not any more with TIP #389. Since such a connection was never documented, no problem: We shouldn't document something that isn't true.
    
    However, there is a problem with TIP #542: According to the current documentation of Tcl_UtfPrev:
    <pre>
    When \fIsrc\fR is greater than \fIstart\fR, it
    always returns a pointer less than \fIsrc\fR and greater than or
    equal to (\fIsrc\fR - \fBTCL_UTF_MAX\fR)
    </pre>
    
    This is not true anymore for Tcl 8.7+. Either change TCL_UTF_MAX to 4 (as they can step over 4 bytes), or make Tcl_UtfNext()/Tcl_UtfPrev() step twice for Characters > 0xFFFF
    
    This ticket is meant to expore the second possibility. If it fails we can always change the documentation. If it works, then Tcl_UtfCharComplete() can be used - again - to protect Tcl_UtfNext calls.
    
  5. is_private changed to: "0"
  6. login: "jan.nijtmans"
  7. priority changed to: "5 Medium"
  8. resolution changed to: "None"
  9. severity changed to: "Minor"
  10. status changed to: "Open"
  11. submitter changed to: "jan.nijtmans"
  12. subsystem changed to: "44. UTF-8 Strings"
  13. title changed to:
    connection between Tcl_UtfNext/Tcl_UtfPrev and Tcl_UtfCharComplete()
    
  14. type changed to: "RFE"