Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 8deddf15776eaf907bc8bad7efd291c35aa54115e1cc73ae2ae5c5ac7234a96d
Ticket: f443140a8547b6f6d70c51a6bbf742e72dca0ca8
connection between Tcl_UtfNext/Tcl_UtfPrev and Tcl_UtfCharComplete()
User & Date: jan.nijtmans on 2020-04-28 20:52:36
Changes

  1. icomment:
    Just a little demo [bb68f27f5b47ad4f]
    
    With a little adaption, "testutfnext" can check whether it overflows the give bytes. For example, try to remove the \x00 from the end of utf-6.9:
    
    <pre>
    ==== utf-6.9 Tcl_UtfNext FAILED
    ==== Contents of test case:
        testutfnext -bytestring \xA0
    ---- Test generated error; Return code was: 1
    ---- Return code should have been one of: 0 2
    ---- errorInfo: Tcl_UtfNext is not supposed to read src[end]
        while executing
    "testutfnext -bytestring \xA0"
        ("uplevel" body line 2)
        invoked from within
    "uplevel 1 $script"
    ---- errorCode: NONE
    ==== utf-6.9 FAILED
    </pre>
    
    This way, we don't need new test-cases with a "numbytes" argument. In the same way, "testutfnext" tests whether src[-1] is read, but we know it doesn't
    
    Hope you like it!
    
  2. login: "jan.nijtmans"
  3. mimetype: "text/x-fossil-wiki"