unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
Subject: Re: converting between charsets
Date: Sun, 07 May 2006 08:43:56 -0400	[thread overview]
Message-ID: <87u082109z.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87lktejh6f.fsf@myxomop.com> (Alexander Kotelnikov's message of "Sun, 07 May 2006 13:52:08 +0400")

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

Emacs always converts from/to the encoding you use.  So you don't really
need to "convert from utf-8 to koi8", when sending email because, before the
email is sent, it's not any more in utf-8 than in any other encoding (other
than the internal encoding).
I.e. all you need is to tell Emacs that when sending to newsgroups such and
such, it should use koi8 rather than utf-8.  How to do that depends on the
newsreader you're using.

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

I don't think that's true in theory.

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

Looks like you have some problems here.  Try to remove most of the lines
(if your locale is using utf-8 already, you really don't need to do
anything at all in your .emacs).
At the very least try removing the set-selection-coding-system and
set-input-mode.

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

Probably caused by your set-selection-coding-system.

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

Could be because of your set-input-mode.


        Stefan

  reply	other threads:[~2006-05-07 12:43 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-07  9:52 converting between charsets Alexander Kotelnikov
2006-05-07 12:43 ` Stefan Monnier [this message]
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

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=87u082109z.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    /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).