Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b66ce02af5879efcdddf8d81daedb51eecd83940e48f558ce5bbeb40f069a604
Ticket: 11ae2be95dac941790db43dcfb265f8586072cd8
tip-389 branch: string range errors with code points greater than U+FFFF
User & Date: jan.nijtmans on 2018-01-10 15:45:28
Changes

  1. icomment:
    I'll have a loot at "string range"  and "string index". In the current implementation, a character > \U0ffff occupies 2 locations in the string (= actually 'character array'). So we must implement a precaution that we can never point in the middle of a upper/lower surrogate pair. That's what goes wrong here.
    
    The best thing to do is - I think - to round up any index that points in the middle of a surrogate pair. So, what I would expect:
    
    % string range a\U10000b 0 0
    a
    % string range a\U10000b 1 1
    \U10000 (however that would be displayed ...)
    % string range a\U10000b 2 2
    
    % string range a\U10000b 3 3
    b
    
    Indeed, there's still something to be done here.
    
    Thanks!
    
  2. login: "jan.nijtmans"
  3. mimetype: "text/plain"