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 23:28:09 -0400	[thread overview]
Message-ID: <87d5ep1a2c.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <84veshaajc.fsf@vinci.loc> (Alexander Kotelnikov's message of "Sun, 07 May 2006 23:40:23 +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.]
SM> 
SM> Emacs always converts from/to the encoding you use.  So you don't really
SM> need to "convert from utf-8 to koi8", when sending email because, before the
SM> email is sent, it's not any more in utf-8 than in any other encoding (other
SM> than the internal encoding).
SM> I.e. all you need is to tell Emacs that when sending to newsgroups such and
SM> such, it should use koi8 rather than utf-8.  How to do that depends on the
SM> newsreader you're using.

> I am using Gnus, it does not have such functionality,

In what way does the functionality described in the node "Charsets" of the
Gnus manual fail to provide the functionality you need?

>>> Theoretically something like
>>> (encode-coding-region (point-min) (point-max) 'koi8-r)
>>> should work, but it does not.
SM> I don't think that's true in theory.
> Why?

Because it completely depends on how and when you do it.  There already is
an encoding step taking place somewhere.  So if you only add a call to
encode-coding-region somewhere you'll simply cause a double encoding to
happen which will most likely give you garbage.

So one way to do it is to take care of the encoding yourself, which may
amount to doing the whole "send" yourself (i.e. the NIH approach).  Or the
other way is to figure out how to tell the code that already does the
encoding to use koi8 rather than utf-8.

> I have started emacs without ~/.emacs and evaluated 
> (setq default-input-method "cyrillic-jcuken")

What's your locale?  What version of Emacs is this?

> What I got:
> 1. Paste into Emacs frame works strange:

What text did you paste?  Where does it come from?

> Cyrillic nput in emacs -nw in xterm still does not work, if I just
> change X keyboard layout.

That doesn't give us much to go on, does it?  What does it do, other than
"not work"?


        Stefan

  reply	other threads:[~2006-05-08  3:28 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
2006-05-07 19:40   ` Alexander Kotelnikov
2006-05-08  3:28     ` Stefan Monnier [this message]
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=87d5ep1a2c.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).