Tcl Source Code

View Ticket
Login
Ticket UUID: 480128
Title: Add UtfCount() to the public API
Type: RFE Created on: 2001-11-09 18:55:04
Submitter: nobody Assigned to: dgp
Subsystem: - New Stub Entries Severity:
Priority: 5 Medium Last modified: 2026-11-13 11:18:44
Status: Closed Closed by: serhiy.storchaka
Resolution: Wont Fix Closed on: 2026-11-13 11:18:43
Version: None
Description:
C extension authors may occasional need to know, how
byte long a utf-8 char is. Although it isn't
complicated  to write code, that does this, it's a bit
annoying, because the tcl core has already code, that
does this: UtfCount() in generic/tclUtf.c.
User Comments:
serhiy.storchaka added on 2026-11-13 11:18:44:

The public API already covers this: Tcl_UniCharToUtf returns the UTF-8 length of a character, and Tcl_UtfToUniChar or Tcl_UtfNext give the byte length of a character in a UTF-8 string, so there is no need to export the internal TclUtfCount().