emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cyrillic, utf-8 and windows


From: Kenichi Handa
Subject: Re: Cyrillic, utf-8 and windows
Date: Wed, 10 Dec 2003 08:58:28 +0900 (JST)
User-agent: SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.2 Emacs/21.3 (sparc-sun-solaris2.6) MULE/5.0 (SAKAKI)

Thank you for the report.  

In article <address@hidden>, Sam Steingold <address@hidden> writes:
>> 
>>  I can open in Emacs a utf-8 file with Cyrillic characters in it and it
>>  is displayed just fine - with correct glyphs &c.
>>  I set `default-input-method' to "cyrillic-yawerty" in .emacs,
>>  so when I try C-\ `toggle-input-method', I get 2 "character outline
>>  boxes" in the modeline and when I type, I see these "character outline
>>  boxes" in the buffer instead of the characters I just typed.
>>  When I save the buffer, kill it, and re-visit the file,
>>  I see what I just typed displayed correctly as Cyrillic!
>>  So, why does Emacs display the characters that I type as boxes
>>  (rectangles) but shows them correctly when loaded from a file on disk?

Because those are different character for Emacs as you
already found as below.

> when I type using cyrillic-yawerty, I get this:
[...]
>     charset: cyrillic-iso8859-5
[...]
> when I save the file, kill the buffer and visit the file again, that
> character becomes
[...]
>     charset: mule-unicode-0100-24ff

> So, how do I tell cyrillic-yawerty to insert UTF-8?!

The input method cyrillic-yawerty generates iso-8859-5
characters, and Emacs has a facility to automatically adjust
an input character to what the buffer-file-coding-system
expects.  But, I found a bug in that facility and
insufficiency in set-default-coding-systems (called from
prefer-coding-system).  Please try the attached patch.

But, there still exist one problem.  As you don't have
iso8859-5 fonts, the input-method indicator in the modeline
can't be displayed correctly.  For the moment, Emacs doesn't
has a facility to automatically try the other fonts
(e.g. iso10646-1).  Emacs-unicode version has it.

---
Ken'ichi HANDA
address@hidden

*** ucs-tables.el.~1.34.~       Tue Sep  2 08:25:38 2003
--- ucs-tables.el       Wed Dec 10 08:17:57 2003
***************
*** 2507,2512 ****
--- 2507,2514 ----
                     (coding-system-base default-buffer-file-coding-system))))
        (when cs
        (setq table (coding-system-get cs 'translation-table-for-encode))
+       (if (and table (symbolp table))
+           (setq table (get table 'translation-table)))
        (unless (char-table-p table)
          (setq table (coding-system-get cs 'translation-table-for-input)))
        (when (char-table-p table)
*** mule-cmds.el.~1.249.~       Wed Nov 26 08:10:10 2003
--- mule-cmds.el        Wed Dec 10 08:42:43 2003
***************
*** 321,326 ****
--- 321,331 ----
    o default value for the command `set-keyboard-coding-system'."
    (check-coding-system coding-system)
    (setq-default buffer-file-coding-system coding-system)
+   (if (fboundp 'ucs-set-table-for-input)
+       (dolist (buffer (buffer-list))
+       (or (local-variable-p 'buffer-file-coding-system buffer)
+           (ucs-set-table-for-input buffer))))
+ 
    (if default-enable-multibyte-characters
        (setq default-file-name-coding-system coding-system))
    ;; If coding-system is nil, honor that on MS-DOS as well, so




reply via email to

[Prev in Thread] Current Thread [Next in Thread]