
Tcl/Tk4.0b3 locale problem.
I found this yesterday, quite by chance when I tried to select the word
"Naovely" with a double-click in a text widget (that "i" has two dots,
BTW, and on Solaris 2.4)
Further invesigation (ie RingTFM for ctype) lead me to believe that
I need the environment variable "LC_CTYPE" set to "iso_8859_1" and,
indeed, a noddy C program that calls setlocale(LC_ALL, "") and then
prints out all the alnum characters subsequently rewarded me with the
traditional 36 and all the accented letters.
However, Tcl/Tk doesn't help here: there's no call to setlocale() that I
can find anywhere in the sources for either Tcl or Tk. In fact, I can't
find a mention of "locale" in any of the distribution files.
Since applications are responsible for setting the locale themselves
(libraries don't) I think that both tclAppInit.c and tkAppInit.c need
something like this
#ifdef HAVE_LOCALE_H
#include <locale.h>
#endif
...
main (...) {
...
#if defined(HAVE_SETLOCALE) && defined(LC_ALL)
setlocale (LC_ALL, "");
#endif
...
}
and, of course, the appropriate magic in configure.in (about which I
know almost nothing :-)
I'm sure I read somewhere about the fact that a call to setlocale()
had been added to both tclsh and wish and I must admit I was somewhat
surprised to find it missing.
--
ISODE Consortium +44 181 332 9091
These are my opinions and have nothing to do with my employer.