Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 51751ca9cc499b8a47813a4829f793c6d8bd8283d638ee0190fd393436bec1d0
Ticket: 1ecea01196a19b73226d5c822e5fdaf22111aa54
string is lower, upper not consistent with Unicode database and other languages
User & Date: apnadkarni on 2025-07-23 05:13:00
Changes

  1. assignee changed to: "nobody"
  2. closer changed to: "nobody"
  3. cmimetype changed to: "text/x-markdown"
  4. comment changed to:
    For example,
    
    ```
    % string is lower \u00aa
    0
    % regexp {[[:lower:]]} \u00aa
    0
    ```
    
    On the other hand,
    
    ```
    % tcl::unsupported::icu is lower \u00aa; # But see caveat below
    1
    % unicode is lower \u00aa; # Built off the UCD database
    1
    ```
    
    FWIW, Perl, Python, Ruby, Java all report it as lower case.
    
    I estimate over a hundred such mismatches.
    
    The issue is that although Tcl also builds its tables using the Unicode data files, for determining lower or upper case, it only looks at the `General_Category` property of the code point to make the determination. The problem is that the `General_Category` is a disjoint partition so its value only indicates the "most common" usage, not all possible categorizations. That is a problem for code points that can be placed in multiple categories. The standard therefore defines separate `Lowercase` and `Uppercase` properties for this purpose and that is what all other languages look at to characterize a code point as lower or upper case.
    
    I believe Tcl should do the same. If there is agreement on this, the next question is whether changing this can be treated as a bug fix (hopefully!) or needs a TIP.
    
    Opinions on both counts?
    
  5. is_private changed to: "0"
  6. login: "apnadkarni"
  7. priority changed to: "5 Medium"
  8. private_contact changed to: "9546e9877f1a8899e25a89082561ee694e7fb402"
  9. resolution changed to: "None"
  10. severity changed to: "Important"
  11. status changed to: "Open"
  12. submitter changed to: "apnadkarni"
  13. subsystem changed to: "18. Commands M-Z"
  14. title changed to:
    string is lower, upper not consistent with Unicode database and other languages
    
  15. type changed to: "Bug"