Hi,
At 02 Jun 2001 21:26:16 +0200,
Juliusz Chroboczek <[EMAIL PROTECTED]> wrote:
>TK> Now, XTerm-156 + luit-0.6 doesn't support XIM input.
> Correct. Luit doesn't speak X; it only speaks TTY.
I think luit's policy not to speak X is appropriate, since it
might be useful in non-X environment.
> Luit assumes that the tty expects UTF-8 for client output and
> generates UTF-8 for keystrokes. It functions symmetrically: it
> converts application output from ISO 2022 or locale-dependent
> encodings into UTF-8 for the tty, and keyboard input from the TTY from
> UTF-8 into the locale's encoding.
>
> It seems rather clear to me that UTF-8 XTerm should provide keyboard
> input in UTF-8.
I agree, though my opinion is that luit will be a part of XTerm
or be distributed with XTerm and automatically invoked from XTerm.
Thus, now it is clear that XIM support is not luit's responsibility
but XTerm's one. (Now "XTerm" means core part of XTerm other than
luit.)
> You should use Xutf8LookupString in UTF-8 mode. Your code should be
> wrapped within #if OPT_USE_UTF8_API, which will automatically be
> undefined on platforms that don't support Xutf8LookupString.
Then, how can I write in #else ~ #endif ?
I also tested the following patch and failed to input Japanese
character via XIM. Since I can input ASCII character via XIM,
it may be Xutf8LookupString()'s fault.
---
Tomohiro KUBOTA <[EMAIL PROTECTED]>
http://www.debian.or.jp/~kubota/
"Introduction to I18N" http://www.debian.org/doc/manuals/intro-i18n/
--- xterm-156/input.c Thu Jan 25 08:43:31 2001
+++ xterm-156-k1/input.c Sun Jun 3 08:39:27 2001
@@ -336,6 +336,7 @@
short modify_parm = 0;
int keypad_mode = ((keyboard->flags & MODE_DECKPAM) != 0);
#if OPT_WIDE_CHARS
+ int utf8mode = 0;
long ucs;
#endif
@@ -351,16 +352,16 @@
}
else
#endif
-#if OPT_I18N_SUPPORT
- if (screen->xic
#if OPT_WIDE_CHARS
- && !screen->utf8_mode
-#endif
+ if (screen->xic
+ && screen->utf8_mode
) {
Status status_return;
- nbytes = XmbLookupString (screen->xic, event,
- strbuf, sizeof(strbuf),
- &keysym, &status_return);
+ nbytes = Xutf8LookupString (screen->xic, event,
+ strbuf, sizeof(strbuf),
+ &keysym, &status_return);
+ utf8mode ++;
+printf("utf8: nbytes = %d, buf = \"%s\"\n", nbytes, strbuf);
}
else
#endif
@@ -376,7 +377,7 @@
* XLookupString(), we have to generate them here. Once Xlib is fully
* UTF-8 capable, this code here should be removed again.
*/
- if (screen->utf8_mode) {
+ if (screen->utf8_mode && !utf8mode) {
ucs = -1;
if (nbytes == 1 && strbuf[0]) {
/* Take ISO 8859-1 character delivered by XLookupString() */