Tcl Source Code

View Ticket
Login
Ticket UUID: e27c3246c3285fda0bfccad5a6f70e97e112c8ec
Title: Tcl_UtfToChar16 should replace invalid chars with U+FFFD
Type: Bug Created on: 2026-06-05 08:34:05
Submitter: apnadkarni Assigned to: nobody
Subsystem: - New Builtin Commands Severity: Minor
Priority: 5 Medium Last modified: 2026-06-05 08:34:05
Status: Open Closed by: nobody
Resolution: None Closed on:
Version:
Description:

One of the important changes in Tcl 9 was to stop corrupting data by treating invalid UTF-8 sequences as CP1252. Tcl_UtfToChar16 still engages in this behaviour and should be changed. Since error returns are not possible from this function as would be required by the strict profile, they should be handled as in the replace profile by substituting with U+FFFD.