all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: M G Berberich <berberic@forwiss.uni-passau.de>
To: help-gnu-emacs@gnu.org
Subject: Re: changing encoding of buffer
Date: Tue, 29 May 2007 14:39:20 +0200	[thread overview]
Message-ID: <ogjti4-lgh.ln1@manwe.forwiss.uni-passau.de> (raw)
In-Reply-To: mailman.1365.1180383723.32220.help-gnu-emacs@gnu.org

On Mon, 28 May 2007 23:21:34 +0300, Eli Zaretskii <eliz@gnu.org> wrote:
>> From: M G Berberich <berberic@forwiss.uni-passau.de>
>> Date: Mon, 28 May 2007 12:34:47 +0200
>> 
>> When I reply, my newsreader appends my UTF-8 signature and starts
>> emacs.
>
> If you append UTF-8 text unconditionally, I think you are guilty no
> less than MS: no one said that arbitrary encoded text can be freely
> mixed with UTF-8.  Suppose those unnamed "MS-products" did announce
> they produce text in windows-1252, how would that help you avoid the
> problem?

Then my newsreader would convert the text from windows-1252 to UTF-8
(which is my locale environment) before calling emacs and all would
work fine. The problem is that the encoding is not declared, so the
newsreader does not know that it is windows-1252 and not koi8-r or
EBCDIC or latin-2 or  

>> I wrote this function to solve the problem:
>> 
>> (defun fix-ms-posting ()
>>   "Fixes newsposting that are garbled up by Microsoft-Software"
>>   (interactive)
>>   (let ((coding-system-for-write 'raw-text)
>> 	(coding-system-for-read 'utf-8)
>> 	(end (progn (end-of-buffer) (search-backward "\n-- \n"))))
>>     (revert-buffer-with-coding-system 'utf-8)
>>     (set-buffer-file-coding-system 'utf-8)
>>     (shell-command-on-region (point-min) end 
>> 			     "recode windows-1252..utf-8" nil t)))
>
> I see no need to call `recode': Emacs can do that itself.

Fine, how can this be done?

      MfG
      bmg
-- 
Artikel 3 und 12a des Grundgesetzes  kurz  | M G Berberich
zusammengefaßt: MÀnner  und  Frauen  sind  | berberic@fmi.uni-passau.de
gleichberechtigt, ausgenommen MÀnner, die  |
mÃŒssen zur Bundeswehr.                     | http://www.uni-passau.de/~berberic

  parent reply	other threads:[~2007-05-29 12:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-28 10:34 changing encoding of buffer M G Berberich
2007-05-28 20:21 ` Eli Zaretskii
     [not found] ` <mailman.1365.1180383723.32220.help-gnu-emacs@gnu.org>
2007-05-29 12:39   ` M G Berberich [this message]
2007-05-29 19:52     ` Eli Zaretskii
     [not found]     ` <mailman.1402.1180468336.32220.help-gnu-emacs@gnu.org>
2007-05-29 21:06       ` M G Berberich
2007-05-30  3:22         ` Eli Zaretskii
     [not found]         ` <mailman.1416.1180495357.32220.help-gnu-emacs@gnu.org>
2007-05-30  7:35           ` M G Berberich
2007-05-31 18:19       ` Giorgos Keramidas

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

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

  git send-email \
    --in-reply-to=ogjti4-lgh.ln1@manwe.forwiss.uni-passau.de \
    --to=berberic@forwiss.uni-passau.de \
    --cc=berberic@fmi.uni-passau.de \
    --cc=help-gnu-emacs@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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.