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

Re: [I18n]xterm and XIM



Hi,

At 07 Jun 2001 20:05:50 +0200,
Juliusz Chroboczek <jch@xxxxxxxxxxxxxx> wrote:

>>> 2. Document the fact that it will only work in UTF-8 locales.
> Well, my personal choice would be to make it use Xutf8 if available at
> compile time, and Xmb if not.

XmbLookupString() returns XIM input in locale encoding.
Since non-UTF8 locale will be (and should be -- Unicode is buggy and
should not become popular till bugs will be fixed, otherwise
compatibility problem would occur between "buggy" Unicode and
fixed Unicode) still important for many years, and since most XIM
servers work in _popular_ local locales, XIM input in non-UTF8 locales
is as important as (or more important than) in UTF-8 locales.

Thus, my opinion is:

#if OPT_USE_UTF8_API
   use Xutf8LookupString()
#elif __STDC_ISO_10646__
   use XwcLookupString()
   convert UCS-4 -> UTF-8
#else
   use iconv()
#endif

None of these three ways are completely portable.  Thus all of these three
may improve portability.

(Bruno, do you have any idea about Xutf8LookupString() bug
which I mentioned a few days ago with a tiny patch?  I glanced
XFree86 source [xc/lib/X11/*] and was too difficult for me...
See http://www.xfree86.org/pipermail/i18n/2001-June/001943.html)


>H>   3. setlocale to UTF-8 locale, and if it fails, just exits.
> I really feel that no software should take the license to override the
> user's locale choices.

I agree with Juliusz.  Indeed, I don't understand Hiura's intension.
Many XIM servers (well, all XIM servers as far as I have used) work
only in locales with local encodings such as ja_JP.eucJP and zh_TW.Big5.
setlocale to UTF-8 will disable to use these XIM servers (such as
kinput2, skkinput, ami, and xcin).

---
Tomohiro KUBOTA <kubota@xxxxxxxxxx>
http://www.debian.or.jp/~kubota/
"Introduction to I18N"  http://www.debian.org/doc/manuals/intro-i18n/
-
Linux-UTF8:   i18n of Linux on all levels
Archive:      http://mail.nl.linux.org/linux-utf8/