Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 632d1f48e742032f7b93e14724079f76f0a9807e9b62ccfc9d7b44b3fc71ffb5
Ticket: 535705ffffffffffffffffffffffffffffffffff
Tcl interface to stop on encoding errors
User & Date: jan.nijtmans on 2021-05-07 10:06:38
Changes

  1. icomment:
    > I am not in favor to include the byte value in hex of the input byte causing the conversion error. The reasons are: ...
    
    Well, how about a better error-message then? The first byte of invalid UTF-8 tells something useful: If it is between 0x80-0xBF or 0xC1 or between 0xF8-0xFF then that's the error-byte. If it is 0xC0 or between 0xC2-0xF7 then it's a follow-up byte problem.
    
    > When converting to a single byte encoding (example ISO-8859-1), the error byte value will be the first byte of an utf-8 sequence. IMHO this causes more issues than it helps.
    
    The error-message contains the character value in this case, not a byte value. It shows the character code, which must be < 0xFF for ISO-8859-1.
    
    I changed the error-message now to "unexpected byte sequence starting at index ..."
    
  2. login: "jan.nijtmans"
  3. mimetype: "text/x-fossil-wiki"