Menu

#3134 TclpSetInitialEncodings works only once on Unix

obsolete: 8.4.9
closed-fixed
7
2005-11-03
2005-05-13
No

I think I found a bug in Tcl that prevents a tclkit to
find and use the proper system encoding in a
non-English locale.

Of course, it is not a bug for Tcl itself, because this
function
is really called just once on startup (and does its job).

But tclkit has to call it twice --- on startup and after
mounting VFS which contains encoding files.

A patch to unix/tclUnixInit.c:
-----------------PATCH---------------------
--- tclUnixInit.c Thu May 12 20:18:51 2005
+++ tclUnixInit.c.new Thu May 12 20:14:03 2005
@@ -485,7 +485,8 @@
void
TclpSetInitialEncodings()
{
- if (libraryPathEncodingFixed == 0) {
+
+/* if (libraryPathEncodingFixed == 0) { */
CONST char *encoding = NULL;
int i, setSysEncCode = TCL_ERROR;
Tcl_Obj *pathPtr;
@@ -647,6 +648,7 @@
* dependent behavior.
*/

+ if (libraryPathEncodingFixed == 0) {
setlocale(LC_NUMERIC, "C");

/*
-----------------PATCH---------------------

This problem really needs to be fixed --- it makes tclkit
practically unusable for non-English users. And I don't
see a way how Tcl will suffer from it.

Discussion

<< < 1 2 (Page 2 of 2)
  • Don Porter

    Don Porter - 2005-11-02
    • assigned_to: dgp --> hobbs
     
  • Don Porter

    Don Porter - 2005-11-02

    Logged In: YES
    user_id=80530

    Experts on the Tcl'ers chat say
    the TclApp product from ActiveState
    will solve this issue.

    Since it's a solved problem, the
    Activators can determine what
    further changes need to go
    into Tcl.

     
  • Don Porter

    Don Porter - 2005-11-02

    Logged In: YES
    user_id=80530

    Very up-to-date Tclkits based on
    Tcl/Tk 8.5 development sources
    are available at

    http://www.kroc.tk/tclkit/current/inter.htm

    I've just verified they do not suffer
    from this problem. Simplest thing
    might be to just use them.

     
  • Yaroslav Schekin

    Logged In: YES
    user_id=1272045

    I rebuild tclkit with all encoding files (as described at
    http://www.equi4.com/tkunicode.html\).

    I know that it's fixed in Tclkit8.5a4 (I reported that to
    Andreas
    Kupries earlier), but this bug report is about tclkit8.4.x.

    And, Tcl/Tk 8.4 is still the current stable version.

     
  • Don Porter

    Don Porter - 2005-11-03
    • status: open --> closed-fixed
     
  • Don Porter

    Don Porter - 2005-11-03

    Logged In: YES
    user_id=80530

    Thanks for that reference.

    Following the instructions at
    http://www.equi4.com/218
    and the continuing instructions at
    http://www.equi4.com/tkunicode.html
    I was able to both confirm the
    reported bug, and confirm that the
    attached patch does fix the bug.

    Committing patch for Tcl 8.4.12.

     
  • Don Porter

    Don Porter - 2005-11-03
    • assigned_to: hobbs --> dgp
     
<< < 1 2 (Page 2 of 2)