Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 1f177abdc89e83dbda89138ffb8fb5044f282751e296d7ec3b43f5e6f547ed46
Ticket: 1ecea01196a19b73226d5c822e5fdaf22111aa54
string is lower, upper not consistent with Unicode database and other languages
User & Date: serhiy.storchaka on 2026-09-20 11:31:32
Changes

  1. icomment:
    Some precision on Python, since it was cited: for a single character <tt>str.islower()</tt> tests the Unicode derived property <tt>Lowercase</tt> (general category Ll plus <tt>Other_Lowercase</tt>) and <tt>str.isupper()</tt> the <tt>Uppercase</tt> property, which is what this ticket proposes. For a string the rule is "all cased characters are lowercase and there is at least one cased character", so <tt>"2a".islower()</tt> is true, but <tt>"2".islower()</tt> and <tt>"".islower()</tt> are false. It is not the definition D139 of the standard (toLowercase(X) = X), which would accept "2" and "".
    
    Note that Tcl is also inconsistent with itself here: <tt>string toupper \u2170</tt> gives \u2160 and <tt>string toupper \u24d0</tt> gives \u24b6 (both are Other_Lowercase, with categories Nl and So), but <tt>string is lower</tt> returns 0 for them. Using the Lowercase property would make <tt>string is lower</tt> agree with <tt>string toupper</tt>.
    
  2. login: "serhiy.storchaka"
  3. mimetype: "text/x-fossil-wiki"