[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Bug while locale in utf8
From: |
Kenichi Handa |
Subject: |
Re: Bug while locale in utf8 |
Date: |
Fri, 23 Sep 2005 11:14:54 +0900 |
User-agent: |
SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/22.0.50 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI) |
In article <address@hidden>, Jason Rumney <address@hidden> writes:
> Yiyi Hu wrote:
>> If the locale is zh_CN.gbk or zh_CN.gb2312, then, after
>> starting Emacs, I use X input method (*fcitx*) to input
>> some Chinese characters. It will display correctly. After
>> I changed locale to zh_CN.utf8.If I use X input method
>> (*fcitx*) to do the same input, I will get =8e4=8bd=8a0
>> such kind of chars.
>>
> ....
>> And I also noticed that after I opened a file which is in
>> utf-8 encoding. It will load four more libraries.
>>
>> subst-jis subst-ksc subst-big5 subst-gb2312
>>
>> So I tried to load it manually. But Not works for manual
>> loading...
>>
>>
> Loading files should not have side-effects, so that is
> expected. You need to call the appropriate functions. In
> this case, utf-translate-cjk-load-tables is the user level
> function that loads and sets up these tables.
It seems that more and more users start using UTF-8 locale.
set-language-environment already has a code to call
utf-translate-cjk-load-tables if it was previously called in
the different language enviroment.
I've just installed the attached fix which calls
utf-translate-cjk-load-tables when one of CJK lang. env. is
selected even if it's not yet called previously.
So, in the latest code, you don't need any special setting.
> I don't understand enough about the auto-loading of the
> tables to know why it works when utf-8 files containing
> CJK characters are loaded, but not for utf-8 keyboard
> input. But at least the above might give you a better work
> around for your .emacs.
On reading a file, utf-8-post-read-conversion is called and
it (re)loads the tables if necessary. But, the decoding of
keyboard input via XIM is done in handle_one_xevent of
xterm.c, and I'm not sure we can call Lisp there. So, I
dared not call post-read-conversion function there.
---
Kenichi Handa
address@hidden
2005-09-23 Kenichi Handa <address@hidden>
* international/mule-cmds.el (set-language-environment): Don't
check utf-translate-cjk-lang-env is nil or not on deciding if we
have to call utf-translate-cjk-load-tables.
Index: mule-cmds.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/international/mule-cmds.el,v
retrieving revision 1.281
retrieving revision 1.282
diff -c -r1.281 -r1.282
*** mule-cmds.el 1 Sep 2005 14:30:30 -0000 1.281
--- mule-cmds.el 23 Sep 2005 02:12:37 -0000 1.282
***************
*** 1901,1907 ****
(if (functionp func)
(funcall func)))
(if (and utf-translate-cjk-mode
- utf-translate-cjk-lang-env
(not (eq utf-translate-cjk-lang-env language-name))
(catch 'tag
(dolist (charset (get-language-info language-name 'charset))
--- 1901,1906 ----