Mailing List Archive

Support open source code!


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XIM, kinput2 & Tk



>> From: "Stephen J. Turnbull" <turnbull@example.com>
>> (2) It explicitly opens an X Input Method:
>> 
>>     (a) It sets the program's locale using the standard library
>>         function setlocale(), either from the environment (default) or
>>         explicitly.  Eg, "ja_JP.eucJP".  I think it specifically looks
>>         at the LANG and LC_ALL variables, but not at any of the
>>         subcategories.

Where in the configuration is LANG, etc. set? I note that in my
/etc/X11/xinit/xinitrc.d/xinput it looks at LC_ALL and if it contains
ja_JP it starts kinput2. Presumably LC_ALL gets set before then, but
where?

>>     (b) It gets the (possibly program-augmented) contents of the
>>         XMODIFIERS environment variable.  This is a string of the form
>> 
>>         "@example.com=value;@example.com=value..."
>> 
>>         AFAIK the only implemented tag is @example.com  Then it extracts the
>>         order list of input methods such as "@example.com=isoaccent;@example.com=kinput2".
>> 
>>     (c) Then it does XOpenIM(...).  XOpenIM walks the list, attempting
>>         to contact each method in turn, and on success asking "do you
>>         do $LANG?"  isoaccent says "ja? bu-wha-ha-ha!".  XOpenIM
>>         translates that to "iie"[1], and goes on to kinput2.  Kinput2
>>         says "hai!", they shake hands, and XOpenIM returns a struct
>>         _xim or something like that that Xlib will use to control
>>         console input thereafter.

What if a user wants to run an app that switches between a Korean IM and
a German one? Locales can't be changed on the fly

>> In your case, you need (a) XMODIFIERS="@example.com=kinput2" 

Got that.

>> and (b)
>> LANG="ja_JP.eucJP" (probably, works for me but YYMV) in your
>> environment or you will lose.  Of course, you may lose anyway; this is
>> XIM.

Doesn't work. Possibly because LC_ALL contains "C", according to the
return from setlocale().

-- 
Jim Breen  [jwb@example.com  http://www.csse.monash.edu.au/~jwb/]
Visiting Professor, Institute for the Study of Languages and Cultures of 
Asia and Africa, Tokyo University of Foreign Studies, Japan
+81 3 5974 3880         [$B%8%`!&%V%j!<%s(B@$BEl5~30Bg(B]


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links