Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: c9d1f0dd1ff971a870261952ee0a18fc1d498e1b
Ticket: 584603ffffffffffffffffffffffffffffffffff
'encoding convertfrom' causes error messages
User & Date: andreas_kupries on 2002-07-23 10:12:06
Changes

  1. icomment:
    
    
    File Added - 27568: 584603.tar.gz
    
    Logged In: YES 
    user_id=75003
    
    And back in the encoding subsystem ...
    WriteChars uses Tcl_UtfToExternal. In
    the ok case I get result 0, 1 char read,
    converted and written. In the failure case
    result is -1, 0 chars read, converted,
    written => infniite loop.
    
    Another difference: In the ok case the system
    uses identity to write the result of the command,
    definitely something from the wrong init. In
    the failure case it tries to use iso-8859-1
    
    Ah, the result -1 means that the chars are the
    beginning of a multibyte sequence which cannot
    be converted without more characters.
    
    This could point back to the [encoding convertfrom],
    i.e. should it not have generated valid utf-8 ? The
    result of [encoding convertfrom identity \xe2] was
    \xe2! Invalid utf-8.
    
    Note: WriteChars expects that it is given a valid
    and complete UTF-8 sequence. Partial UTF-8 is AFAIK
    not allowed. IIRC Rolf Ade fell into that trap too
    one time when working on tDOM.
    
    Attaching patch for my trace output and relevant logs.
    
    
  2. login: "andreas_kupries"
  3. mimetype: "text/plain"
  4. username: "andreas_kupries"