Overview
| Artifact ID: | ce5e1994d629943b89ee318251f2bea058bf27dc6a33c7ee199735f677c24d17 |
|---|---|
| Ticket: | fa3d9fd818fa0072b60dcd14614ebf33d90e4d6b
[fcopy $chan1 $chan2 -size $size] is not [puts -nonewline $chan2 [read $chan1 -size $size] |
| User & Date: | pooryorick on 2023-04-03 20:55:33 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
Even if two channels have he same encoding [fcopy $chan1 $chan2 -size] might not be the same as [fcopy $chan1 $chan2 -size]. The makes [fcopy -size] difficult to use correctly. In the following script, copying with a size of 1 between to channels, both using utf-8 encoding, does not copy a full character. Although the behaviour is currently documented to be what it is, it's still bad, and should be fixed: <code><verbatim> set chan [file tempfile] chan configure $chan -encoding utf-8 -profile strict puts -nonewline $chan รก flush $chan chan configure $chan -profile tcl8 -translation lf -eofchar {} seek $chan 0 set chandata [read $chan] set chan2 [file tempfile] chan configure $chan2 -profile tcl8 -encoding utf-8 seek $chan 0 fcopy $chan $chan2 -size 1 flush $chan2 seek $chan2 0 set chan2data [read $chan2] close $chan2 puts [list fcopy equals original? [expr {$chan2data eq $chandata}]] set chan3 [file tempfile] chan configure $chan2 -profile tcl8 -encoding utf-8 seek $chan 0 puts -nonewline $chan3 [read $chan 1] close $chan seek $chan3 0 set chan3data [read $chan3] puts [list read/write equals original? [expr {$chan3data eq $chandata}]] </verbatim></code> - is_private changed to: "0"
- login: "pooryorick"
- priority changed to: "5 Medium"
- private_contact changed to: "2b2275eab1118e1fab0016cf1c5702893c6af86c"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "pooryorick"
- subsystem changed to: "25. Channel System"
- title changed to:
[fcopy $chan1 $chan2 -size $size] is not [puts -nonewline $chan2 [read $chan1 -size $size]
- type changed to: "Bug"