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

    From Uwe Schmitz@21:1/5 to All on Fri Dec 13 16:02:51 2024
    Folks,

    is it possible in Tcl9 to get the old (8.x) behaviour back,
    that tcl files are read with system encoding instead of
    utf-8?
    Is there e.g. an environment variable or a configure
    switch to change this?

    I found:

    --with-encoding encoding for configuration values (default: utf-8)

    but, what is meant with "configuration values"?

    I've the problem that almost all of my sources contain some
    umlauts and are, for legacy reasons, in iso8859-1. If it's
    not possible to get the old behavior back, I have to
    edit every pkgIndex.tcl and every tclsh <script> call
    before I'm able to migrate.

    Thanks in advance
    Uwe

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Harald Oehlmann@21:1/5 to All on Fri Dec 13 16:17:48 2024
    Am 13.12.2024 um 16:02 schrieb Uwe Schmitz:
    Folks,

    is it possible in Tcl9 to get the old (8.x) behaviour back,
    that tcl files are read with system encoding instead of
    utf-8?
    Is there e.g. an environment variable or a configure
    switch to change this?

    I found:

    --with-encoding         encoding for configuration values (default: utf-8)

    but, what is meant with "configuration values"?

    I've the problem that almost all of my sources contain some
    umlauts and are, for legacy reasons, in iso8859-1. If it's
    not possible to get the old behavior back, I have to
    edit every pkgIndex.tcl and every tclsh <script> call
    before I'm able to migrate.

    Thanks in advance
    Uwe


    Hi Uwe,
    source -encoding iso8859-1 $file

    I put those in the package index files which source the package files.
    Remark that msgcat message files are always in utf-8.

    The great TCL9 migration helper by Ashok tries to find the related files.

    Take care,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)
  • From Uwe Schmitz@21:1/5 to All on Fri Dec 13 16:41:45 2024
    Hi Harald,

    source -encoding iso8859-1 $file

    I put those in the package index files which source the package files.
    Remark that msgcat message files are always in utf-8.

    I was worried that I would have to add this to all
    my packages. However, that seems manageable.

    I'm more worried that I also have to add the encoding
    to all my ksh/bash scripts that call Tcl via
    tclsh <scriptfile>.

    I've already made a note of Ashok's migration helper.
    I wanted to use it in the next step. I didn't expect
    to run into migration problems during installation
    (where some simple Tcl scripts are used, e.g. for
    documentation purposes).

    Thanks for your answer!
    Uwe

    Am 13.12.2024 um 16:17 schrieb Harald Oehlmann:
    Am 13.12.2024 um 16:02 schrieb Uwe Schmitz:
    Folks,

    is it possible in Tcl9 to get the old (8.x) behaviour back,
    that tcl files are read with system encoding instead of
    utf-8?
    Is there e.g. an environment variable or a configure
    switch to change this?

    I found:

    --with-encoding         encoding for configuration values (default: utf-8)

    but, what is meant with "configuration values"?

    I've the problem that almost all of my sources contain some
    umlauts and are, for legacy reasons, in iso8859-1. If it's
    not possible to get the old behavior back, I have to
    edit every pkgIndex.tcl and every tclsh <script> call
    before I'm able to migrate.

    Thanks in advance
    Uwe


    Hi Uwe,
    source -encoding iso8859-1 $file

    I put those in the package index files which source the package files.
    Remark that msgcat message files are always in utf-8.

    The great TCL9 migration helper by Ashok tries to find the related files.

    Take care,
    Harald

    --- SoupGate-Win32 v1.05
    * Origin: fsxNet Usenet Gateway (21:1/5)