unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Kenichi Handa <handa@m17n.org>
Cc: emacs-devel@gnu.org
Subject: Re: Cyrillic, utf-8 and windows
Date: Wed, 10 Dec 2003 08:58:28 +0900 (JST)	[thread overview]
Message-ID: <200312092358.IAA16526@etlken.m17n.org> (raw)
In-Reply-To: <ufzftq26b.fsf@gnu.org> (message from Sam Steingold on Tue, 09 Dec 2003 13:25:00 -0500)

Thank you for the report.  

In article <ufzftq26b.fsf@gnu.org>, Sam Steingold <sds@gnu.org> 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
handa@m17n.org

*** 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	other threads:[~2003-12-09 23:58 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-08 18:39 Cyrillic, utf-8 and windows Sam Steingold
2003-12-09 18:25 ` Sam Steingold
2003-12-09 23:58   ` Kenichi Handa [this message]
2003-12-11 19:38     ` Sam Steingold
2003-12-11 23:20       ` Kenichi Handa
2003-12-10  1:27   ` Jason Rumney
2003-12-10  7:20     ` Roman Belenov
2003-12-11 19:39       ` Sam Steingold

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200312092358.IAA16526@etlken.m17n.org \
    --to=handa@m17n.org \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).