Artifacts Associated With Ticket 219210
Ticket change [0a3b23d5ec] (rid 113780) by nobody on 2000-10-26 05:03:38:
- assignee initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
OriginalBugID: 3662 Bug Version: 8.2.2 SubmitDate: '1999-11-23' LastModified: '1999-12-07' Severity: SER Status: Assigned Submitter: techsupp ChangedBy: hobbs OS: All FixedDate: '2000-10-25' ClosedDate: '1999-12-06' Name: Nikolai Saoukh set out [open k.txt w] fconfigure $out -encoding koi8-r puts $out "\u0410\u0410" close $out set in [open k.txt r] fconfigure $in -encoding koi8-r set out [open u.txt w] fconfigure $out -encoding utf-8 fcopy $in $out close $in close $out It's not certain whether this is an RFE or bug, as the fcopy man page states that it only pays heed to the -translation option, not to -encoding. This could be a bug, since -encoding came after fcopy was originally written. The work-around is to replace the above fcopy with: puts $out [read $in] although there is no callback capability then. -- 12/07/1999 hobbs - foundin initialized to: "obsolete: 8.2.2"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- status initialized to: "Open"
- submitter initialized to: "nobody"
- subsystem initialized to: "63. (unused)"
- title initialized to: "fcopy does not respect encodings"
- type initialized to: "Bug"
Ticket change [a3b02c3788] (rid 110084) by andreas_kupries on 2000-11-17 19:08:40:
- icomment:
I consider it as bug, an incomplete adaption of the existing commands to the new i18n features, i.e. encodings. Recategorized to OtherIO as this problem is not restricted to sockets.
- login: "andreas_kupries"
- mimetype: "text/plain"
- priority changed to: "6"
- subsystem changed to: "62. (unused)"
- username: "andreas_kupries"
- icomment:
Ticket change [ed49e51557] (rid 103852) by dkf on 2001-02-05 04:27:25:
- subsystem changed to: "24. Channel Commands"
Ticket change [a346c88f9e] (rid 110024) by andreas_kupries on 2001-03-31 00:05:13:
- assignee changed to: "andreas_kupries"
- icomment:
Logged In: YES user_id=75003 Another problem with the workaround: It uses much more memory than fcopy because the whole file is loaded into the interpreter before written back out.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
Ticket change [d32acb3766] (rid 123246) by andreas_kupries on 2001-03-31 20:22:45:
- icomment:
Logged In: YES user_id=75003 The fix for this report has to be done in "tclIO.c", "CopyData", which currently uses "DoRead" and "DoWrite" for reading from and writing to the channels involved in the copying. Exchanging these two calls against stripped down versions of "Tcl_ReadChars" and "Tcl_WriteChars" should do the trick. "Stripped down" means here that we have avoid the call to "CheckChannelErrors" in these two routines as this routine flags their usage for a channel used in an "fcopy" as an error. I would propose to move the meat of these two routines into two internal procedures "DoReadChars" and "DoWriteChars" which are then called from the original routines. The originals would retain the error checking. And "CopyData" can use the internal procedures to get its own work done. Note the following consequences of the change: - The system will use UTF-8 internally when copying data, meaning that it will consume more memory, or copy less data per buffer. - Performance will be affected negatively because of the additional conversions to and from UTF-8. (Side note: Do we have performance tests for "fcopy" in "tclbench" ?). The code of the channel system uses 'statePtr->encoding == NULL' as signal that the encoding is binary, and the two "Tcl_*Chars" procedures have special provisions for that case. Unfortunately not very efficient as it involves ByteArray objects. I would propose that "CopyData" should check for binary translation on _both_ channels and fall back to the old code in such a case. This would avoid quite a lot of conversions and copying. We shouldn't do this for a mixture of binary and non-binary encodings as we still need an intermediate ByteArray to get the conversion right for these cases, causing additional complexity in the new code. Better to stay with the tried and true code for that for now.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [a82a6ba8d4] (rid 98930) by andreas_kupries on 2001-04-04 21:36:54:
- icomment:
Logged In: YES user_id=75003 Uploading a patch fixing the bug, adding tests and extending the documentation.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Add attachment "219210.diff.1" [ded6e7507f] (rid 114918) by andreas_kupries on 2001-04-04 21:36:54.
Ticket change [d384218883] (rid 123301) by andreas_kupries on 2001-04-04 21:36:55:
- icomment:
File Added - 4953: 219210.diff.1
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [e884a6b4c2] (rid 104658) by andreas_kupries on 2001-04-06 22:20:34:
- icomment:
Logged In: YES user_id=75003 New patch, changing the fix slightly so that it doesn't do conversions which are not necessary. IOW, if both channels are set to the same encoding no conversion will occur and the transfer will run at the full old speed. The first patch did conversions in this case, lowering performance for a common case.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Add attachment "219210.diff.3" [6ce496a0d1] (rid 128599) by andreas_kupries on 2001-04-06 22:20:34.
Ticket change [025108279c] (rid 119623) by andreas_kupries on 2001-04-06 22:20:35:
- icomment:
File Added - 5076: 219210.diff.3
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [8ee2f8073b] (rid 120195) by andreas_kupries on 2001-04-19 03:23:20:
- icomment:
Logged In: YES user_id=75003 Another small change to the patch, fixing another bug. Found through tclbench, i.e. performance tests. Will add the performance results too, with notes.
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Add attachment "219210.diff.5" [14caad5185] (rid 124462) by andreas_kupries on 2001-04-19 03:23:20.
Ticket change [ac27bd5155] (rid 101244) by andreas_kupries on 2001-04-19 03:23:21:
- icomment:
File Added - 5514: 219210.diff.5
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Add attachment "fce.Benchmark.out.tar.gz" [3d3b0d2360] (rid 121055) by andreas_kupries on 2001-04-19 03:27:32.
Ticket change [177d097e96] (rid 122506) by andreas_kupries on 2001-04-19 03:27:32:
- icomment:
File Added - 5515: fce.Benchmark.out.tar.gz
- login: "andreas_kupries"
- mimetype: "text/plain"
- username: "andreas_kupries"
- icomment:
Ticket change [961f1bec75] (rid 106270) by andreas_kupries on 2001-05-20 00:05:41:
- closedate changed to: "2001-05-19T17:05:41"
- closer changed to: "andreas_kupries"
- icomment:
Logged In: YES user_id=75003 Patch committed.
- login: "andreas_kupries"
- mimetype: "text/plain"
- resolution changed to: "Fixed"
- status changed to: "Closed"
- username: "andreas_kupries"