Re: Tcl9: source files are interpreted as utf-8 by default

Liste des GroupesRevenir à cl tcl 
Sujet : Re: Tcl9: source files are interpreted as utf-8 by default
De : schmitzu (at) *nospam* mail.de (Uwe Schmitz)
Groupes : comp.lang.tcl
Date : 07. Jan 2025, 18:00:15
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vljmj2$29vdo$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
Sorry that I have to come back to this issue.
As stated before, we use iso8859-1 as system encoding.
With Tcl9 we now got errors reading source files with e.g. umlauts,
because Tcl9 interprets all sources as utf-8 by
default. That means we have to add "-encoding iso8859-1"
to ALL source and ALL tclsh calls in ALL scripts.
So far, so good(or bad?).
What initially seems quite doable, looks more and more scary
to me. First, if we ever may switch encoding to utf-8 we
have to alter all those lines again. Either we switch them to utf-8 or
we remove the -encoding and went back
to the state before Tcl9.
Another point: we have MANY scripts only for development needs.
Coded quickNdirty for code generation, documentation, packaging, etc.
Most of them called by "tclsh helperScript.tcl ..." (they have no shebang or
whatever). They now have to be called by
"tclsh -encoding iso8859-1 helperScript.tcl ..."
Thats a lot more typing.
Some of them have a usage message like:
usage: tclsh helperScript.tcl arg1 arg2
...
Do we now have to change it to:
usage: tclsh -encoding iso8859-1 helperScript.tcl arg1 arg2
...
?
Side note: The open command, which opens a file with the
system encoding by default, has thankfully not changed
in the same manner as source and tclsh :-).
Now my suggestion:
Wouldn't it be convenient for Tcl9 to have a global switch
(e.g. Environment variable) to get back the Tcl8 encoding
behaviour?
Or, isn't it best to keep the old encoding mimik in Tcl9.
I see no advantage in the new behavior. Even if you have
all sources in utf-8, you might also have choosen utf-8 as
system encoding.
Do we have (or can we have) a magic comment or something else
with which we can choose the encoding of a source file in
the file itself?
Python e.g. has https://peps.python.org/pep-0263/.
Maybe I’m missing something crucial...
Thanks in advance
Uwe

Date Sujet#  Auteur
13 Dec 24 * Tcl9: source files are interpreted as utf-8 by default40Uwe Schmitz
13 Dec 24 +* Re: Tcl9: source files are interpreted as utf-8 by default2Harald Oehlmann
13 Dec 24 i`- Re: Tcl9: source files are interpreted as utf-8 by default1Uwe Schmitz
7 Jan 25 `* Re: Tcl9: source files are interpreted as utf-8 by default37Uwe Schmitz
7 Jan 25  +* Re: Tcl9: source files are interpreted as utf-8 by default5Harald Oehlmann
8 Jan 25  i`* Re: Tcl9: source files are interpreted as utf-8 by default4Uwe Schmitz
8 Jan 25  i `* Re: Tcl9: source files are interpreted as utf-8 by default3Harald Oehlmann
8 Jan 25  i  `* Re: Tcl9: source files are interpreted as utf-8 by default2Harald Oehlmann
8 Jan 25  i   `- Re: Tcl9: source files are interpreted as utf-8 by default1Uwe Schmitz
7 Jan 25  `* Re: Tcl9: source files are interpreted as utf-8 by default31Luc
8 Jan 25   `* Re: Tcl9: source files are interpreted as utf-8 by default30Uwe Schmitz
8 Jan 25    `* Re: Tcl9: source files are interpreted as utf-8 by default29Luc
8 Jan 25     `* Re: Tcl9: source files are interpreted as utf-8 by default28Luc
8 Jan 25      `* Re: Tcl9: source files are interpreted as utf-8 by default27Uwe Schmitz
8 Jan 25       `* Re: Tcl9: source files are interpreted as utf-8 by default26Luc
8 Jan 25        `* Re: Tcl9: source files are interpreted as utf-8 by default25Rich
8 Jan 25         `* Re: Tcl9: source files are interpreted as utf-8 by default24Luc
8 Jan 25          `* Re: Tcl9: source files are interpreted as utf-8 by default23Rich
8 Jan 25           +* Re: Tcl9: source files are interpreted as utf-8 by default12Luc
8 Jan 25           i+- Re: Tcl9: source files are interpreted as utf-8 by default1ted@loft.tnolan.com (Ted Nolan
8 Jan 25           i`* Re: Tcl9: source files are interpreted as utf-8 by default10Rich
9 Jan 25           i `* Re: Tcl9: source files are interpreted as utf-8 by default9Uwe Schmitz
9 Jan 25           i  `* Re: Tcl9: source files are interpreted as utf-8 by default8Rich
9 Jan 25           i   +* Re: Tcl9: source files are interpreted as utf-8 by default6Luc
10 Jan 25           i   i`* Re: Tcl9: source files are interpreted as utf-8 by default5Rich
10 Jan 25           i   i `* Re: Tcl9: source files are interpreted as utf-8 by default4Luc
10 Jan 25           i   i  `* Re: Tcl9: source files are interpreted as utf-8 by default3eric
10 Jan 25           i   i   `* Re: Tcl9: source files are interpreted as utf-8 by default2Luc
10 Jan 25           i   i    `- Re: Tcl9: source files are interpreted as utf-8 by default1Rich
10 Jan 25           i   `- Re: Tcl9: source files are interpreted as utf-8 by default1Uwe Schmitz
8 Jan 25           `* Re: Tcl9: source files are interpreted as utf-8 by default10saito
9 Jan 25            `* Re: Tcl9: source files are interpreted as utf-8 by default9Rich
9 Jan 25             `* Re: Tcl9: source files are interpreted as utf-8 by default8Luc
9 Jan 25              `* Re: Tcl9: source files are interpreted as utf-8 by default7Rich
9 Jan 25               `* Re: Tcl9: source files are interpreted as utf-8 by default6Luc
9 Jan 25                +* Re: Tcl9: source files are interpreted as utf-8 by default4Uwe Schmitz
9 Jan 25                i`* Re: Tcl9: source files are interpreted as utf-8 by default3Harald Oehlmann
10 Jan 25                i `* Re: Tcl9: source files are interpreted as utf-8 by default2Uwe Schmitz
10 Jan 25                i  `- Re: Tcl9: source files are interpreted as utf-8 by default1Harald Oehlmann
9 Jan 25                `- Re: Tcl9: source files are interpreted as utf-8 by default1Rich

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal