Hi,

At Fri, 26 Jan 2001 09:02:09 +0900,
Tomohiro KUBOTA <[EMAIL PROTECTED]> wrote:

I misunderstand you on some points...

> > Wouldn't it be possible to take an existing euc-jp XIM and convert the
> > resulting character to UTF-8 at the very end?
> 
> Not every time. Because
>  - some XIM are proprietary softwares. 
>  - some users may prefer a certain _old_ version of certain input method.

Which do you mean by 'the very end'?
If it is XIM side, I think it is maybe possible, though there are problems
I wrote above.
If it is client side, it can be done without any problem.
Recent XTerm does it.


> > I already added code to switch to using UTF-8 internally when $LANG contains
> > "utf-8" or "utf8".  The input functions then assume that typed characters also
> > arrive as UTF-8.  How do I find out what encoding the XIM produces?

Please use UTF-8 (or other Unicode) as internal encoding everytime.
Exception is when setlocale() fails or returns "C" or "POSIX" locale.
For X softwares, also check XSupportsLocale().

When UTF-8 mode, use nl_langinfo(CODESET) and iconv() everytime.
It can cover UTF-8 locale also.  (Under UTF-8 locale, iconv() will
convert from UTF-8 to UTF-8.  If you don't like the overhead, you
can check UTF-8 locale additionally and bypass iconv().)  Assume
all I/O are processed in encoding of nl_langinfo(CODESET).

---
Tomohiro KUBOTA <[EMAIL PROTECTED]>
http://surfchem0.riken.go.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/lists/

Reply via email to