Mailing List Archive

Support open source code!


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

Re: ATOK messed up after XF86-4.0.2 upgrade



Christopher SEKIYA <wileyc@example.com> writes:

> On Wed, Mar 21, 2001 at 12:18:46PM +0100, Mike Fabian wrote:
> 
> > Can you give an example what exactly doesn't work? Does it happen
> > in all applications or only in kterm?
> 
> (hell with kterm, it has nasty incestuous knowledge of kinput2)

I asked because kterm used to work fine with kinput2, then suddenly
stopped working when I upgraded glibc from 2.1.3 to 2.2.

The reason was that kterm used the setlocale() function in a strange
way.  kterm had an internal list of Japanese locales:
"ja_JP.ujis", "ja_JP.EUC", ja_JP.eucJP" ...

kterm then used these locales as parameters for setlocale calls:

    setlocale(LC_CTYPE,"ja_JP.ujis")
    setlocale(LC_CTYPE,"ja_JP.EUC")
    setlocale(LC_CTYPE,"ja_JP.eucJP")
    ...

checked the return value of the setlocale calles and
stopped after the first successful setlocale() call.

The first successful setlocale() call was the first on the list, using
"ja_JP.ujis" I usually have the environment variable LC_CTYPE=ja_JP
set.  I.e. these do not match. On glibc 2.1.3, this was no problem, it
worked nevertheless. On glibc 2.2, it only worked when I did set the
environment variable LC_CTYPE to exactly the same value as the first
successful one on kterm's internal list.

When I reordered kterm's internal list and recompiled,
I also had to change the LC_CTYPE variable accordingly,
to make it match the value used in kterms first
successful setlocale() call again.

I thought using such an internal list of locales which
the user has no chance of knowing unless reading
the source code is nonsense anyway and changed
the setlocale call to the more common setlocale(LC_CTYPE,"").
Then it worked for all spelling variants of the japanese locale.

I remembered this strange bug when you talked about
XMODIFIERS not matching the current LOCALE setting
and thought you were maybe talking of this problem.

After upgrading to glibc 2.2, I was also suprised at first
that XIM in kterm suddenly worked only for LC_CTYPE=ja_JP.ujis
whereas it had worked for the other equivalent Japanese
locales as well on glibc 2.1.3.

-- 
Mike Fabian   <mfabian@example.com>


Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links