Deutsch   English   Français   Italiano  
<103di4o$1s2ei$1@dont-email.me>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: Harald Oehlmann <wortkarg3@yahoo.com>
Newsgroups: comp.lang.tcl
Subject: Re: Tcl 8.6 vs 9.0 encoding plus some general confusion
Date: Tue, 24 Jun 2025 08:55:21 +0200
Organization: A noiseless patient Spider
Lines: 49
Message-ID: <103di4o$1s2ei$1@dont-email.me>
References: <mbr60nF6lf9U1@mid.individual.net> <ygaqzzaai1z.fsf@akutech.de>
 <103btkq$1bs7q$1@dont-email.me> <ygams9ya01d.fsf@akutech.de>
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Date: Tue, 24 Jun 2025 08:55:21 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c298b2c3f9e49450bb0b13b061c6e981";
	logging-data="1968594"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX1/M0K3CrXo8tpLPeKQMw8kD"
User-Agent: Mozilla Thunderbird
Cancel-Lock: sha1:JIlwMu8LP7LMLM/uKkYdHhIv6uk=
In-Reply-To: <ygams9ya01d.fsf@akutech.de>
Content-Language: en-GB

Am 23.06.2025 um 18:35 schrieb Ralf Fassel:
> * Rich <rich@example.invalid>
> | Ralf Fassel <ralfixx@gmx.de> wrote:
> | >     ## Notable incompatibilities
> | >      - Removed the encoding alias `binary` to `iso8859-1`.
>>
> | This feels like unnecesary exposure of internal details that an end
> | user is not concerned about.
>>
> | A user wants to read "binary" data, it would seem that they would
> | expect to use "binary" as the name for that "encoding" (well, really, a
> | lack of any encoding).  If it indeed was mapped to iso8859-1
> | internally, that is an internal implemntation detail that is of no
> | concern to them.
> 
> The tcl-9 manpage is not clear on this topic IMHO:
> 
>    https://www.tcl-lang.org/man/tcl/TclCmd/chan.html
> 
> On the one hand, it states for -encoding:
>    https://www.tcl-lang.org/man/tcl/TclCmd/chan.html#M11
>    
>      If a file contains pure binary data (for instance, a JPEG image), the
>      encoding for the channel should be configured to be iso8859-1. Tcl will
>      then assign no interpretation to the data in the file and simply read or
>      write raw bytes.
> 
> Two sentences later:
>      It is usually better to set the -translation option to binary when
>      you want to transfer binary data, as this turns off the other
>      automatic interpretations of the bytes in the stream as well.
> 
> And for -translation:
>    https://www.tcl-lang.org/man/tcl/TclCmd/chan.html#M17
>      binary
>        Like lf, no end-of-line translation is performed, but in addition,
>        sets -eofchar to the empty string to disable it, and sets
>        -encoding to iso8859-1.
> 
> This sounds to me that configuring only "-encoding iso8859-1" is *not*
> enough to read binary data (since crlf translation and eofchar handling
> might still apply), and that the "usually better" should really read
> "necessary to".
> 
> R'

Yes, "-translation binary" has also the advantage to work on 8.6 and 9.0.