Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 76b1a695d4a72ba795b8aefea6976ef04ef7d4db
Ticket: 1908077fffffffffffffffffffffffffffffffff
string trim not trimming Unicode spaces
User & Date: escargo on 2008-03-05 15:04:50
Changes

  1. assignee changed to: "nijtmans"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    A string containing a leading Unicode nonbreaking space (\u00A0) did not have that character removed by [string trim ...] (no chars specified for removal).
    
    In Unicode there are several "whitespace" characters that  [string trim] does not remove by default. (See http://en.wikipedia.org/wiki/Whitespace_%28computer_science%29
    for a working definition of white space.)
    
    Ironically, [string is space ...] will return 1 for most of these characters, signifying that at some level these characters are known to be spaces.
    
    Interestingly, the Unicode NEL (Next Line), \u0085 gets 0 from [string is space \u0085].
    So do the following two:
    U180E MONGOLIAN VOWEL SEPARATOR
    U205F MEDIUM MATHEMATICAL SPACE
    
    There are 3 issues then.
    
    [string is space ...] returns the wrong results for certain Unicode characters.
    
    [string trim ...] (the form without characters specified) is not deleting Unicode space characters.
    
    The documentation for [string trim ...] is not precise about which space characters are deleted (or not deleted).
    
    The behavior of [string trim ...] should (in my opinion) be defining as removing those characters for which [string is space .] is 1.
    
    If [string trim ...] only trims ASCII white space characters, then they should be explicitly described and listed.
    
    
  4. foundin changed to: "obsolete: 8.4.18"
  5. is_private changed to: "0"
  6. priority changed to: "5 Medium"
  7. resolution changed to: "None"
  8. status changed to: "Open"
  9. submitter changed to: "escargo"
  10. subsystem changed to: "44. UTF-8 Strings"
  11. title changed to: "string trim not trimming Unicode spaces"
  12. type changed to: "Bug"