---------- Weitergeleitete Nachricht ---------- Subject: Re: [m17n] CJK Input Date: Mon, 07 Jan 2002 18:39:08 +0100 From: Mike Fabian <mfabian@suse.de> To: ugroh@t-online.de (Ulrich Groh) Cc: m17n@suse.com ugroh@t-online.de (Ulrich Groh) writes:
I installed CJK on my system and tested e.q. the Wadalab tex-files.
You mean /usr/share/doc/packages/cjk-latex/examples/Wadalab-test.tex? -> Yes, this file
Everything went well (I can LaTeX the file, see the Kanji on the screen etc.).
If I edit the file with xemacs, I only see the strange numbers like $B? etc., even if I start the environment as described in the CJK-Manual.
What environment? -> I did the following: -> export XMODIFIERS="@im=kinput2" -> LANG=ja_JP kinput2 -xim -kinput -canna& -> LANG=de_DE LC_TYPE=ja_JP xemacs
If I enter Japanese text inside xemacs, I can see the Kanji clearly. But if I save and LaTeX the file everything is gone (empty space).
I am sure that I am doing something wrong (maybe inside xemacs), but I haven't found yet the right hint.
The Wadalab-test.tex file is in EUC-JP encoding. Probably you do not specify this encoding while loading this file into XEmacs. If you don't specify the encoding, XEmacs tries to guess and guessing the encoding right isn't always possible. To specify the encoding explicitly, first start XEmacs without giving the file name on the command line: ~$ xemacs then load the file using C-u C-x C-f Wadalab-test.tex RET euc-jp RET or C-x RET c euc-jp C-x C-f Wadalab-test.tex RET The first key combination works only with XEmacs, the second works with both XEmacs and Emacs. If specify the file name on the command line when starting XEmacs ~$ xemacs -q /usr/share/doc/packages/cjk-latex/examples/Wadalab-test.tex XEmacs tries to guess the encoding and the result of the guessing is influenced by your locale setting. For example: ~$ LC_ALL=ja_JP xemacs -q /usr/share/doc/packages/cjk-latex/examples/Wadalab-test.tex will guess correctly, because Japanese encodings are preferred when XEmacs is started in a Japanese locale. But when you start XEmacs like ~$ LC_ALL=de_DE xemacs -q /usr/share/doc/packages/cjk-latex/examples/Wadalab-test.tex it will guess wrong and you will see mojibake (unreadable nonsense). Probably you have not set ja_JP as your default locale (Please check the output of the 'locale' command). [...]
By the way: We can't I see the New Years Greetings in KMail ?
新年おめでごさいま。
Probably your font-settings in KMail are not suitable for Japanese, or you did select an unsuitable encoding to display incoming mails from the KMail menu. Usually, setting the encoding to "automatic" should be OK. If you set it to something like "iso-8859-1", you won't see Japanese correctly. -> "automatic" is not available. All other encodings don't work. But I can -> see yours Japanese writings. -- Mike Fabian <mfabian@suse.de> http://www.suse.de/~mfabian 睡眠不足はいい仕事の敵だ。 ------------------------------------------------------- -- $B?7G/$*$a$G$4$6$$$^$9!#(B Best regards Ulrich Groh
ugroh@t-online.de (Ulrich Groh) writes:
Everything went well (I can LaTeX the file, see the Kanji on the screen etc.).
If I edit the file with xemacs, I only see the strange numbers like $B? etc., even if I start the environment as described in the CJK-Manual.
What environment?
-> I did the following: -> export XMODIFIERS="@im=kinput2" -> LANG=ja_JP kinput2 -xim -kinput -canna& -> LANG=de_DE LC_TYPE=ja_JP xemacs ^C (a 'C' is missing here)
unless you have something in your ~/.xemacs/init.el file which influences the priority of the guessing of the coding systems when loading new files, XEmacs will probably guess wrong if you load a Japanese file because you have set LANG=de_DE. You can make XEmacs guess right for Japanese files even when starting with the enviroment above by adding (set-language-environment "Japanese") to your ~/.xemacs/init.el. You can verify this by executing: ~$ LANG=de_DE LC_CTYPE=ja_JP xemacs -q --eval '(set-language-environment "Japanese")' /usr/share/doc/packages/cjk-latex/examples/Wadalab-test.tex which will show the Japanese correctly. The same command line without --eval '(set-language-environment "Japanese")' will lead to garbled Japanese. Or, you can specify the encoding explicitly when loading the file like I explained here:
To specify the encoding explicitly, first start XEmacs without giving the file name on the command line:
~$ xemacs
then load the file using
C-u C-x C-f Wadalab-test.tex RET euc-jp RET
or
C-x RET c euc-jp C-x C-f Wadalab-test.tex RET
The first key combination works only with XEmacs, the second works with both XEmacs and Emacs.
Or, as a third possibility, you can add something like % -*- coding: euc-jp -*- into the first line of your .tex file. If (X)Emacs finds -*- coding: foo -*- in the first line of a file, it will load the file with the encoding 'foo' unless you override it manually with the above mentioned key sequence.
[...]
By the way: We can't I see the New Years Greetings in KMail ?
新年おめでごさいま。
Probably your font-settings in KMail are not suitable for Japanese, or you did select an unsuitable encoding to display incoming mails from the KMail menu. Usually, setting the encoding to "automatic" should be OK. If you set it to something like "iso-8859-1", you won't see Japanese correctly.
-> "automatic" is not available.
I don't know how the German translation looks like. In Japanese, the menu entry is '自動'. You can find this in the KMail menu at メッセージ → エンコーディング → 自動 自動 should translate to something like 'automatisch' in German. If you want to do it manually, one of 'eucjp', 'jis7', 'sjis' or 'utf8' from the KMail menu should work.
All other encodings don't work. But I can -> see yours Japanese writings.
Your first mail with the subject '[m17n] CJK Input]' was in iso-2022-jp encoding (that is the same as 'jis7' from the KMail menu) and had the correct, corresponding MIME tag in its header: Content-Type: text/plain; charset="iso-2022-jp" My response used the same encoding. If you can read my response, you should be able to read your own mail with the same settings. Your second mail with the subject 'Fwd: Re: [m17n] CJK Input' used euc-jp encoding: Content-Type: text/plain; charset="euc-jp" this isn't very common for Japanese e-mail, but possible. When you set the encoding to display mails in your KMail menu to '自動' , 'automatisch' (or whatever the German translation is), you should see Mails in both iso-2022-jp and euc-jp encoding correctly without having to switch the encoding manually in the menu *if* the mails have correct MIME headers (your mail with the subject '[m17n] CJK Input]' had a correct MIME header). -- Mike Fabian <mfabian@suse.de> http://www.suse.de/~mfabian 睡眠不足はいい仕事の敵だ。
Mike, thank you very much for the detailed answer. It helped a much and now everything works as desired. By the way: Where can I find all the informations you mentioned in your answers? Is there a manual available? Best regards Ulrich Groh
ugroh@t-online.de (Ulrich Groh) writes:
Mike, thank you very much for the detailed answer. It helped a much and now everything works as desired.
By the way: Where can I find all the informations you mentioned in your answers? Is there a manual available?
I try to add answers to FAQs to http://www.suse.de/~mfabian/suse-cjk/suse-cjk.html but have not enough time to add everything. -- Mike Fabian <mfabian@suse.de> http://www.suse.de/~mfabian 睡眠不足はいい仕事の敵だ。
Am Sonntag, 20. Januar 2002 18:41 schrieb Mike Fabian:
ugroh@t-online.de (Ulrich Groh) writes:
By the way: Where can I find all the informations you mentioned in your answers? Is there a manual available?
I try to add answers to FAQs to http://www.suse.de/~mfabian/suse-cjk/suse-cjk.html but have not enough time to add everything. Thanks anyway. I also found the link to the Xemacs Manual and now I am in much better shape. -- Mit freundlichen Gruessen / Best regards Ulrich Groh
participants (2)
-
Mike Fabian
-
ugroh@t-online.de