Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: b1fb7e90b019d40a669b6f1efbddd415fb1a9d89abc753ef1e498ebdb07c1680
Ticket: a31caff05780aabdd20a8468673340435862dbf9
encoding command does not allow -strict to be used with -failindex
User & Date: oehhar on 2023-01-16 12:25:39
Changes

  1. icomment:
    Dear Jan,
    about the examples:
    
    "TIP 346" came after TIP 601 and 607, making the examples of TIP607 invalid.
    
    TIP601 already solved the point, that "enocding convertfrom utf-8" does add invalides bytes as verbatim.
    
    Then, TIP 346 came and changed this again and mixed it all up.
    TIP346 defined a new (so far unknown) encoding "utf8 without -strict" which is in the result in big parts identical to "encoding convertfrom -nocomplain utf8".
    
    The difference is:
    
       *   the new encoding "utf8 without -strict" is only with utf-8. 
       *   "-nocomplain" covers all encodings.
    
    So, in consequence, the following are equivalent, expect the codepoint "\xC0\x80":
    
       *   encoding converfrom -nocomplain -strict utf8 $data
       *   encoding convertfrom utf8 $data
    
    This is not the case for other encodings. where -strict just has no effect:
    
       *   encoding converfrom -nocomplain utf16 $data
       *   encoding convertfrom utf16 $data
    
    The first will include any invalid byte verbatim. The 2nd will throw an error on invalid bytes.
    
    I have no way out here.
    But now defining, that (the IMHO toxic "-strict") is implied in "-failindex" makes everything worse and not better.
    
    Sorry, this is my personal opinion, not important.
    
    Take care,
    Harald
    
  2. login: "oehhar"
  3. mimetype: "text/x-fossil-wiki"
  4. username: "oehhar"