Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 26 Aug 2001 14:19:44 -0400 (EDT)
From:      Mikhail Kruk <meshko@cs.brandeis.edu>
To:        Fuyuhiko Maruyama <fuyuhik8@is.titech.ac.jp>
Cc:        <java@FreeBSD.ORG>
Subject:   Re: jdk1.3.1 awt exception, plugin, OpenJIT
Message-ID:  <Pine.LNX.4.33.0108261412520.16406-100000@daedalus.cs.brandeis.edu>
In-Reply-To: <55g0af0wkq.wl@tripper.private>

next in thread | previous in thread | raw e-mail | index | archive | help
> > Exactly. unsetenv LANG did it. (I had ru_RU.KOI8-R) Sorry about that: now
> > I remember this discussion on the list.
> If you are interested in the fact, please see the source code.
>
> at j2sdk1.3.1/src/solaris/native/sun/awt/awt_MToolkit.c:1515
>     if (!XSupportsLocale()) {
>         jio_fprintf(stderr,
>                     "current locale is not supported in X11, locale is set to C"
> );
>         setlocale(LC_ALL, "C");
>     }
>
> The XSupportsLocale() call must return False if Xlib locale-dependent
> functions are not capable for current locale.  Your case,
> ru_RU.KOI8-R, may be the case False to be returned, but it doesn't
> return False.  Therefore, awt skips to setlocale(LC_ALL, "C") and as
> the result, XOpenIM(...) -- a Xlib locale-dependent function returns
> NULL at j2sdk1.3.1/src/solaris/native/sun/awt/awt_InputMethod.c:1071.
> It means that XOpenIM failed.  For locales that Xlib locale-dependent
> functions are capable, XOpenIM fails only when current locale needs
> XIM server to input text in the language specified by current locale
> *AND* the XIM server isn't available.  This is the case can be happen
> in Chinese/Japanese/Korean environment.  For English or some other
> language using latin characters environment that are well supported in
> X11 may never fail.
>
> I'm not sure about Russian environment.  Does setting LANG=C for java
> cause any problems for you?

Well, the thing is that ru_RU.KOI8-R is indeed needed. If I start X
without it, I will not be able to type in cyrillic letters in the xterm.
Also many programs switch to russian localisation mode when started with
LANG set. The fact that Xterm behavor is clearly influenced by the value
of LANG makes me think that it is indeed supported by X (also that's what
I get from reading stuff on the web). The only case when I do see the
above message about  ru_RU.KOI8-R not being supported is when I start
Linux apps (linux-jdk, linux-netscape etc). I'll try to look at the code
but chance that I'll figure something out are rather slim :(
I've just checked native jdk1.1.8. It doesn't allow to enter russian
characters, doesn't complain about locale and doesn't throw any
exceptions.


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-java" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.LNX.4.33.0108261412520.16406-100000>