Sujet : Re: Tcl 8.6 vs 9.0 encoding plus some general confusion
De : rich (at) *nospam* example.invalid (Rich)
Groupes : comp.lang.tclDate : 23. Jun 2025, 16:59:22
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <103btkq$1bs7q$1@dont-email.me>
References : 1 2
User-Agent : tin/2.6.1-20211226 ("Convalmore") (Linux/5.15.139 (x86_64))
Ralf Fassel <
ralfixx@gmx.de> wrote:
and I don't understand this at all. If I say "-encoding
iso8859-1", am I not saying that the data is textual, and that Tcl
should parse it from "iso8859-1" into the internal Unicode as it
reads it?
Looking at the TCL sources for 9.0 and 8.6, it seems that the
'binary' encoding always has been an alias for 'iso8859-1', which has
finally been removed in TCL 9, cf. changes.md:
## 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. Instead, I expect we will start to see a lot of
confusion from user's wondering why they are setting a "character
encoding" when they really wanted to read "binary" data.
Effectively nothing should have changed, except you can no longer
say
chan -encoding binary
in tcl 9 (should have used "-translation binary" anyway).
Keeping the external "binary" alias visible would have been the better
option in my opinion. Even if it was nothing more than an alias for
iso8859-1.