Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 260aba3fceeee6320ba8fe2c8e6ff7be899ecaed3b9a031e3be7232d5a00d66b
Ticket: 28de50dcee4f6888eaed987bf1d795ac67138b5f
Crash on invalid Unicode code points
User & Date: jan.nijtmans on 2026-11-26 08:11:55
Changes

  1. closedate changed to: "2461370.8416117942"
  2. icomment:
    > If that is the case, I would propose mandating TCL_UTF_MAX=4 for Tcl 9
    
    Tcl 9 itself can only be compiled with TCL_UTF_MAX=4. But extensions can compile with -DTCL_UTF_MAX=3, then Tcl_UniChar becomes a short, and (almost) all 'UniChar' API maps  to the Char16 equivalent functions. See [https://core.tcl-lang.org/tips/doc/trunk/tip/497.md|TIP #497], the 'Compatibility section':
    
    'An alternative is compile the extension using -DTCL_UTF_MAX=3. This will restore sizeof(Tcl_UniChar) == 2 as visible for the extension. Almost all (non-deprecated) Tcl API's can still be used by the extension, even the ones using Tcl_UniChar, except: Tcl_NewUnicodeObj(), Tcl_SetUnicodeObj(), Tcl_GetUnicodeFromObj(), Tcl_GetUnicode(). There is no need to re-compile Tcl using -DTCL_UTF_MAX=3 for the extension to work.'
    
  3. login: "jan.nijtmans"
  4. mimetype: "text/x-fossil-wiki"