Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 6ac65cb7563487576ebdef480b0c5b1aebd228a0e27bc6993063a5fc9ded39fc
Ticket: 084ab982fea4c32aaab57251eeea0d7c829893a0
Use -strict to disable noncharacters
User & Date: pointsman on 2022-12-02 12:14:29
Changes

  1. closedate changed to: "2459916.01006194"
  2. closer changed to: "pointsman"
  3. icomment:
    One thing is probably not made clear enough by me (probably because I'm in fact try to not sound "a little sharp on the vocal level", although sometimes obviously failing).
    
    Why do we have the fconfigure -strict mode at all? 
    
    The current default is "strict" in the sense of eg. python, that means: raise error on surrogate. Addionally there is -nocomplain, passing all code-points through. Both modes are fine and understandable to have.
    
    Additionally we the mode -strict 1 (which is a bit a confusing name) which raises error on surrogate and noncharacter.
    
    This surely is a "feature" in the sense it has a defined behaviour. But what is the use case? Who needs this? Is this not an more obscure than just minor feature?
    
    Especially since there is also the [string is unicode] feature. An IMHO gross misnomer, did I said this already?
    
    If someone wants the behaviour this fconfigure -strict 1 feature provides one can always do
    
    if {[string is unicode $mystring]} {
        puts $chan $mystring
    } else {
        # Handle case of mystring with noncharacter
    }
    
    instead of 
    
    if {[catch {puts $chan $mystring}]} {
        # Handle case of mystring with noncharacter
    }
    
  4. login: "pointsman"
  5. mimetype: "text/plain"