Subject: Bug Tcl 8.3.0 XIM fixes for Tcl - DN [1]


j.nijtmans@chello.nl - 23 Feb 2000 - comp.lang.tcl

 Tcl 8.3.0 Bug:  Generated by Scriptics' bug entry form at
     http://www.scriptics.com/support/bugForm.html
 Responses to this post are encouraged.
 ------

 Submitted by:  Jan Nijtmans
 OperatingSystem:  All Unix
 Synopsis:  XIM fixes for Tcl

 ReproducibleScript:
 This patch is supplied by m. hirano as part of his XIM fixes. Explanation is in the patch itself, I left it unchanged.

 Patch:
 *** tclUnixInit.c.orig    Wed Oct 13 02:32:49 1999
 --- tclUnixInit.c    Wed Feb 23 20:01:41 2000
 ***************
 *** 411,417 ****
           }
           }
           if (*p != '\0') {
 -         Tcl_DString ds;
           Tcl_DStringInit(&ds);
           Tcl_DStringAppend(&ds, p, -1);

 --- 411,416 ----
 ***************
 *** 433,450 ****
       Tcl_SetSystemEncoding(NULL, encoding);

       /*
 !      * Initialize the C library's locale subsystem.  This is required
 !      * for input methods to work properly on X11. Note that we need to
 !      * retore the initial "C" locale so that Tcl can parse numbers
 !      * properly.  The side effect of setting the default locale should be to
 !      * load any locale specific modules that are needed by X.
        */
 -
 -     Tcl_DStringInit(&ds);
 -     Tcl_DStringAppend(&ds, setlocale(LC_ALL, NULL), -1);
 -     setlocale(LC_ALL, "");
 -     setlocale(LC_ALL, Tcl_DStringValue(&ds));
 -     Tcl_DStringFree(&ds);

       /*
        * In case the initial locale is not "C", ensure that the numeric
 --- 432,451 ----
       Tcl_SetSystemEncoding(NULL, encoding);

       /*
 !      * Hey, Belows are helpful for X11 XIM, NOT!!!!
 !      * If setlocale(LC_ALL, "") are once called, NOT reset to "C"
 !      * BECAUSE OF X11 uses locale sensitive libc routines such as:
 !      *        mblen()
 !      *        mbstowcs()
 !      *        wcstombs()
 !      * Calling setlocale() with proper locale is of course needed,
 !      * futhermore, keeping the proper locale setting is ALSO needed
 !      * for proper XIM operation. If not, in the worst case, Tk dumps
 !      * core.
 !      *
 !      * So Scott, Don't call setlocale() here.
 !      *        m-hirano
        */

       /*
        * In case the initial locale is not "C", ensure that the numeric

 PatchFiles:
     tclUnixInit.c

Last modified
2000-03-11

(195.108.246.55)

Note: you are looking at
the snapshot of an old wiki
- much of this information
is likely to be very outdated