Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 45acc9dad3a22009df8ffb5f361dabf262f96c144cfb8bb41ca96bc3ed4e7967
Ticket: d10d6ddf295864389294b966163a23a58b9a1e72
UTF-16 Unicode escapes should continue to work in version 9.0
User & Date: apnadkarni on 2024-08-12 10:22:59
Changes

  1. icomment:
    Right or wrong, each element of a Tcl string in Tcl 9 is a Unicode *code point*, not a Unicode character. Correspondingly, the Unicode escape sequences map to individual code points. I don't think it advisable to break this consistency.
    
    The 8.x-9.0 issue you are facing is really an result of 8.x not fully supporting non-BMP characters, thereby requiring hacks. In fact, I don't *think* (not confirmed) the snippets you gave even work in 8.6 versions prior to 8.6.10 or thereabouts. Consider the following fundamental inconsistency in 8.6 non-BMP support recently raised on the chat:
    
    ```
    % string length "\ud83d\ude03"
    2
    % llength [split "\ud83d\ude03" ""]
    1
    ```
    
    My take is that applications that need non-BMP support must move to 9.0. Otherwise, niggling issues like the above inconsistency will keep arising. If at all that is not possible, use UTF-8 and specify the `-encoding utf-8` option instead of being dependent on locales.
    
  2. login: "apnadkarni"
  3. mimetype: "text/x-markdown"