Tcl Source Code

Ticket Change Details
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2018 Conference, Houston/TX, US, Oct 15-19
Send your abstracts to
or submit via the online form by Aug 20.

Artifact ID: 5c86fb3dd144ed5f021060a39b916733f323440a
Ticket: 418035470b1306a17cff21dbb78dedfeee3d17f4
tcl.h: #if TCL_UTF_MAX > 4
User & Date: pointsman 2013-12-22 23:12:32

  1. Change assignee to "nobody"
  2. Change closer to "nobody"
  3. Change cmimetype to "text/plain"
  4. Change comment to:

    tcl.h has:

    #if TCL_UTF_MAX > 4 /* * unsigned int isn't 100% accurate as it should be a strict 4-byte value * (perhaps wchar_t). 64-bit systems may have troubles. The size of this * value must be reflected correctly in regcustom.h and * in tclEncoding.c. * XXX: Tcl is currently UCS-2 and planning UTF-16 for the Unicode * XXX: string rep that Tcl_UniChar represents. Changing the size * XXX: of Tcl_UniChar is /not/ supported. */ typedef unsigned int Tcl_UniChar; #else typedef unsigned short Tcl_UniChar; #endif

    (See in context here:

    That means, with TCL_UTF_MAX 4 Tcl_UniChar is still an unsigned short. This is obviously wrong, because a valid 4 byte utf-8 char is beyond the BMP, that means bigger than an unsigned short.

    That define should read as

    #if TCL_UTF_MAX > 3

    as before check-in

    Same in regcustom.h:

  5. Change foundin to "8.6.1"
  6. Change is_private to "0"
  7. Change login to "pointsman"
  8. Change priority to "5 Medium"
  9. Change private_contact to "4ca203a8e925aecdd9419645f936bccf18cd6ea7"
  10. Change resolution to "None"
  11. Change severity to "Minor"
  12. Change status to "Open"
  13. Change submitter to "pointsman"
  14. Change subsystem to "44. UTF-8 Strings"
  15. Change title to "tcl.h: #if TCL_UTF_MAX > 4"
  16. Change type to "Bug"