Overview
| Artifact ID: | f78cf0cc95bc5235345fe7f232f8cf78b84923fc9f4b1526fbc62b84c19952b1 |
|---|---|
| Ticket: | 4a7397e0b3d60f1aebf50331b748da9493dba07d
Tcl 9: fcopy with -strictencoding 1 UTF-8 channels |
| User & Date: | pointsman on 2022-12-22 13:27:22 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/plain"
- comment changed to:
package require Tcl 9 # Create the test data set fd [open "data.txt" w+] fconfigure $fd -encoding binary # Not valid UTF-8 puts $fd AB\xc0\x40CD\nEFG close $fd set in [open "data.txt"] set out [open "copy.txt" w+] fconfigure $in -encoding utf-8 -strictencoding 1 fconfigure $out -encoding utf-8 -strictencoding 1 fcopy $in $out Again I'm not sure how this is supposed to work but the result did surprise me. The script runs to its end without any error. The created file "copy.txt" is byte indentical with "data.txt". Neither the -strictencoding 1 on the in channel nor the -strictencoding 1 on the out channel seem to do anything, if the channels are used with fcopy. At minimum this should be noted either in the fcopy or the fconfigure documentation (I looked but didn't found something about this case atm). Better, I think, would maybe rasing error on the fcopy. But as written I'm not sure how this is supposed to work.
- foundin changed to: "Tcl 9, trunk"
- is_private changed to: "0"
- login: "pointsman"
- priority changed to: "5 Medium"
- private_contact changed to: "4ca203a8e925aecdd9419645f936bccf18cd6ea7"
- resolution changed to: "None"
- severity changed to: "Important"
- status changed to: "Open"
- submitter changed to: "pointsman"
- subsystem changed to: "25. Channel System"
- title changed to: "Tcl 9: fcopy with -strictencoding 1 UTF-8 channels"
- type changed to: "Bug"