XIM works find for Japanese when XEmacs is started with
LC_CTYPE=ja_JP.eucJP xemacs
But when starting XEmacs like
LC_CTYPE=ja_JP.UTF-8 xemacs
I can switch to Japanese input mode using Shift-Space
and enter Japanese, but when committing the Japanese string with
RET, it is inserted as mojibake into the XEmacs buffer.
I tried
(set-coding-priority-list '(utf-8))
(set-coding-category-system 'utf-8 'utf-8))
(set-keyboard-coding-system 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-default-coding-systems 'utf-8)
but none of these settings seems to have any influence on that.
When I try:
mfabian@gregory:/tmp$ echo '-*- coding: utf-8 -*-' > test-file
mfabian@gregory:/tmp$ LC_CTYPE=ja_JP.UTF-8 xemacs -q -eval "(require
'un-define) (set-keyboard-coding-system 'utf-8) (set-terminal-coding-system
'utf-8) (set-default-coding-systems 'utf-8) (set-buffer-file-coding-system
'utf-8) (set-coding-priority-list '(utf-8)) (set-coding-category-system 'utf-8
'utf-8)" test-file
then enter 漢字 using XIM and switch to hex mode with
M-x hexl-mode RET
I find:
00000000: e8b2 8def bda2 e89f 84ef bfbd 2a2d 2063 ............*- c
00000010: 6f64 696e 673a 2075 7466 2d38 202d 2a2d oding: utf-8 -*-
00000020: 0a .
I don't understand what has been inserted here. If I use
M-x set-input-method japanese-canna RET
in the last example instead of XIM to insert 漢字 I get:
00000000: e6bc a2e5 ad97 2d2a 2d20 636f 6469 6e67 ......-*- coding
00000010: 3a20 7574 662d 3820 2d2a 2d0a : utf-8 -*-.
"e6bc a2e5 ad97" is the correct UTF-8 sequence for 漢字. But what
is "e8b2 8def bda2 e89f 84ef bfbd" which is inserted when using XIM?
Any idea what happens here?
--
Mike Fabian <mfabian(a)suse.de>
http://www.suse.de/~mfabian
睡眠不足はいい仕事の敵だ。