Tkinter and locale

Alex Martelli aleax at aleax.it
Mon Jan 14 08:32:22 EST 2002


"Fredrik Juhlin" <laz at strakt.com> wrote in message
news:mailman.1011006320.12385.python-list at python.org...
    ...
> Normally, I have the environment variable LC_CTYPE set to
> "sv_SE.iso-8859-1" to be able to use latin1 chars in various programs.
> It seems, however, as if TK does not like this, because it makes it
> impossible for me to enter latin1 chars in i.e. entry widgets (pasting
> them in works just fine, though).

Is it Tk, or specifically Tkinter?  AFAIK, the only Python-specific
effect of LC_CTYPE is changing a few string functions such as islower,
isupper, ... I guess it IS more likely to be Tk underneath - can you
test with just Tcl/Tk?


> Does anyone have a solution to this to make TK behave as expected?

No, but, for the record: under Windows/NT the behavior is quite
different.  locale.setlocale(locale.LC_CTYPE, "Italian_Italy.1252")
(or lack thereof, or setting to "C") appears to make no difference
to my ability of inputting accented-characters (when my keyboard is
switched to US-international for example).

Again, this seems to point to platform-specific Tk issues, not
present in the Windows implementation but in the X11 one.


Alex






More information about the Python-list mailing list