Skip to content
Tcl Source Code Ticket Change Details
Login

Ticket Change Details

Overview

Artifact ID: 95036280928ca516a0bb72bbbe60da958dbba1a3561e023632ac044303e51bc7
Ticket: 4a7397e0b3d60f1aebf50331b748da9493dba07d
Tcl 9: fcopy with -strictencoding 1 UTF-8 channels
User & Date: pointsman on 2023-01-26 15:19:14
Changes

  1. icomment:
    > If the channel doesn't have -command specified, an exception should be thrown
    > when an encoding error occurs. If -command is specified, the command
    > will be called with 2 arguments 
    
    Yes, of course - raise error in case of working not in the background and if working in the background then use the already established error reporting way via second argument to the callback.
    
    > Another tweak: according to the documentation: https://core.tcl-lang.org/tcl/file?name=doc/fcopy.n&ci=f9cdaa50ad760a0c&ln=29-30
    
    Just as note: The chan command documentation should be updated according to all fcopy documentation change.
    
    > For Tcl 9.0, it should become: size is in bytes if the input channel is in binary mode, and is in characters otherwise. 
    
    That would be along the lines of how it it is. To be sure: You mean independent of -strict status of the channels?
    
    I'm not so sure if this is what is needed in practice (say, copy file from server and the size of the file to expect is given (typically) in bytes in the header) but this is cleary outside the scope of this ticket. 
    
    So, I guess: Yes, I agree with respect to Tcl 9.
    
    For 8.7 the proposed rule would even be more complicated as it alread is: -size is interpreted as bytes for binary channels _and_ if the channels have the same encoding and no -strict 1. But that may be indispensable.
    
  2. login: "pointsman"
  3. mimetype: "text/x-fossil-plain"