Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 0ce3136dc980ed9e282fa2c4369d02c6487ad61e
Ticket: 3085390fffffffffffffffffffffffffffffffff
Non-BMP characters folded back to BMP
User & Date: lars_h on 2010-10-11 17:30:45
Changes

  1. assignee changed to: "pvgoran"
  2. cmimetype changed to: "text/plain"
  3. comment changed to:
    Checking whether a string is a valid XML name is conveniently done using a regexp, although doing this by the book is slightly cumbersome as there are rather many character ranges to include in the character ranges. Still, the other day I set out to do it. One of the character ranges is from U+10000 to U+EFFFF, i.e., it consists entirely of characters outside the Basic Multilingual Plane that Tcl currently is restricted to. Since the regexp engine provides the \U<8 hex digits> syntax for going beyond the BMP, I thought I could throw in this \U00010000-\U000EFFFF range as well for Forward Compatibility. Unfortunately, this turned out to not be the case.
    
    What appears to happen is that an \Uxxxxyyyy is treated as \uyyyy, since
    
    % regexp {[\U00010020]} " "
    1
    % regexp {\U00010020} " "
    1
    % regexp {\U00010020} !
    0
    % regexp {[\U00010020-\U00010022]} !
    1
    % regexp {[\U00010020-\U00020020]} !
    0
    
    What I would expect to happen is that \U sequences for characters outside the BMP are simply treated as something which doesn't match any string, but I understand that this is a bit esoteric and not of high priority. However, at the very least there should be tests (perhaps with "known bug" constraints) that e.g. \U00010020 does not match \u0020. If I understand reg.test correctly, there currently aren't *any* tests of \U where the match should fail.
    
    
    
    
  4. foundin changed to: "obsolete: 8.6b1"
  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: "lars_h"
  10. subsystem changed to: "43. Regexp"
  11. title changed to: "Non-BMP characters folded back to BMP"
  12. type changed to: "Bug"