Sujet : Re: Tcl9: source files are interpreted as utf-8 by default
De : luc (at) *nospam* sep.invalid (Luc)
Groupes : comp.lang.tclDate : 08. Jan 2025, 16:40:55
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <20250108124055.15c92a05@lud1.home>
References : 1 2 3 4 5 6 7
On Wed, 8 Jan 2025 16:04:26 +0100, Uwe Schmitz wrote:
Another idea: force all scripts to source a set_encoding.tcl file
stored somewhere. If you ever have to change, you change the one file
and move on. You could even make it blank if convenient or necessary.
Nice try, but I don't think it's possible to set the encoding within the
file. And that for one simple reason: the file has already been read.
**************************
That doesn't sound quite true to me. Why is there an 'encoding' command
then? Is it useless because whenever you use it it's too late because
the file has already been read? Unlikely.
Source the set_encoding.tcl file before anything else, before you even
try to read anything. If you can set the encoding on the command line,
you can set it on the first line of the script that command line is
supposed to run.
-- Luc>