unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* converting between charsets
@ 2006-05-07  9:52 Alexander Kotelnikov
  2006-05-07 12:43 ` Stefan Monnier
  0 siblings, 1 reply; 19+ messages in thread
From: Alexander Kotelnikov @ 2006-05-07  9:52 UTC (permalink / raw)


Hello.

After I switched to utf-8 as my basic environment encoding (on Linux)
I got need of converting some texts sometimes back to koi8-r. Typical
task here is to convert outgoing mail to persons and newsgroups
hierarchies which do not understand multibyte encodings.]

Theoretically something like
(encode-coding-region (point-min) (point-max) 'koi8-r)
should work, but it does not.

There could be three different ways, which I checked, how characters
to be converted can appear in emacs buffer:
  a. when I open such file.
  b. when I type in characters and my keyboard layout in X is different
     from 'us', for me it is normally 'ru' then.
  c. when I type in after I used toggle-input-method.


And the trouble is that encode-coding-region converts only in case
(c). In (a) and (b) characters that need conversion are substituted
with question marks. And even in (c) conversion is performed (if, for
instance, I save a file after it appears to be in koi8-r) in the
converted buffer converted characters are shown in \321 manner.

So, it will be nice to get some help on this, thanks.

Relevant lines in my ~/.emacs are:

(set-language-environment "UTF-8")
(set-terminal-coding-system 'utf-8)
(set-selection-coding-system 'utf-8)
(setq default-buffer-file-coding-system 'utf-8)
(set-input-mode (car (current-input-mode)) (nth 1 (current-input-mode)) 0)
(setq default-input-method "cyrillic-jcuken")

BTW, there are other troubles with handling charters other that first
half of ASCII table:

1. Paste in X (from non-Emacs to Emacs) does not work correctly. It
seems to be broken in different ways for singlebyte and mutlibyte.

2. With my utf-8 setup non-ascii input does not work on terminal (for
example, when emacs is run in xterm as emacs -nw) when I switch input
with system means (X keyboard layout, console input mode), instead of
toggle-input-method.

Probably, somebody can comment on this also.

Thanks once more,
-- 
Alexander Kotelnikov
Saint-Petersburg, Russia

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2006-05-17 15:20 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-07  9:52 converting between charsets Alexander Kotelnikov
2006-05-07 12:43 ` Stefan Monnier
2006-05-07 19:40   ` Alexander Kotelnikov
2006-05-08  3:28     ` Stefan Monnier
2006-05-08  9:39       ` Alexander Kotelnikov
2006-05-08 14:30         ` Stefan Monnier
2006-05-09  5:41           ` Alexander Kotelnikov
2006-05-09 18:42             ` Stefan Monnier
2006-05-13 18:42               ` Alexander Kotelnikov
2006-05-14  3:20                 ` Stefan Monnier
2006-05-14 17:53                   ` Alexander Kotelnikov
2006-05-15  0:37                     ` Stefan Monnier
2006-05-15  5:55                       ` Alexander Kotelnikov
2006-05-15  6:02                         ` Alexander Kotelnikov
2006-05-15 14:11                         ` Stefan Monnier
2006-05-15 20:30                           ` Alexander Kotelnikov
2006-05-16  3:50                             ` Stefan Monnier
2006-05-16 10:04                               ` Alexander Kotelnikov
2006-05-17 15:20                                 ` Stefan Monnier

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).