Gnus development mailing list
 help / color / mirror / Atom feed
From: Jesper Harder <harder@ifa.au.dk>
Subject: Re: Editing UTF-8 mail messages
Date: Sun, 13 Oct 2002 06:42:59 +0200	[thread overview]
Message-ID: <m3elavlzjg.fsf@defun.localdomain> (raw)
In-Reply-To: <shfzvn7cb3.fsf@tux.gnu.franken.de> (Karl Eichwalder's message of "Thu, 03 Oct 2002 17:49:04 +0200")

[-- Attachment #1: Type: text/plain, Size: 1113 bytes --]

Karl Eichwalder <keichwa@gmx.net> writes:

> Editing UTF-8 encoded mail messages does not seem to work reliably.
> I'll append such a message mailed to myself using lynx with "wide"
> ncurses support.
>
> The problem: Press e (gnus-summary-edit-article), then C-c C-c.  Saving
> back the message Gnus turns it into a base64 encoding and worse, it
> does not seem to preserve the UTF-8 charset.

You are seeing two different problems:

1. When you do a plain `e' Gnus, mangles the encoding.  This seems to be
   one of the usual MULE-related \201-problems.

   In this case it's caused by `mm-get-part' (in mm-decode.el), which
   uses the macro `mm-with-unibyte-current-buffer-mule4'.  This macro
   does *not* make the buffer unibyte temporarily.

   I don't understand the point of `mm-w-u-c-b-mule4' -- it doesn't
   work.  Why is it ever used?  I suspect that the use of it in several
   places could be causing some of the occasional \201-problems.

   `mm-with-unibyte-current-buffer' *does* work, though.  And if we use
   that macro instead, the problem is fixed (but maybe it breaks older
   Emacsen?).


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: mm-decode.el.diff --]
[-- Type: text/x-patch, Size: 446 bytes --]

--- /home/harder/gnus/lisp/mm-decode.el	Thu Jul 25 21:34:42 2002
+++ mm-decode.el	Sun Oct 13 06:12:36 2002
@@ -953,7 +953,7 @@
   "Return the contents of HANDLE as a string."
   (mm-with-unibyte-buffer
     (insert (with-current-buffer (mm-handle-buffer handle)
-	      (mm-with-unibyte-current-buffer-mule4
+	      (mm-with-unibyte-current-buffer
 		(buffer-string))))
     (mm-decode-content-transfer-encoding
      (mm-handle-encoding handle)

[-- Attachment #3: Type: text/plain, Size: 426 bytes --]


2. If you want to preserve the CTE and charset, you should use `C-u 3 e'.

   Unfortunately, this seems to be broken for text/plain messages.  The
   buffer-local variable `gnus-article-mime-handles' is not set for
   text/plain.  I don't know if it's omitted on purpose -- does someone
   know?.

   If it isn't supposed to be set, then here's a patch that will make
   Gnus construct a MIME handle, when you do `C-u 3 e'.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #4: gnus-sum.el.diff --]
[-- Type: text/x-patch, Size: 546 bytes --]

--- /home/harder/gnus/lisp/gnus-sum.el	Thu Oct  3 20:25:04 2002
+++ gnus-sum.el	Sun Oct 13 06:09:41 2002
@@ -8938,7 +8938,10 @@
 	    (and (gnus-buffer-live-p gnus-article-buffer)
 		 (with-current-buffer gnus-article-buffer
 		   (prog1
-		       gnus-article-mime-handles
+		       (or gnus-article-mime-handles
+			   (and (gnus-buffer-live-p gnus-original-article-buffer)
+				(with-current-buffer gnus-original-article-buffer
+				  (mm-dissect-buffer t))))
 		     (setq gnus-article-mime-handles nil))))))
      (t
       (setq force t)))

  reply	other threads:[~2002-10-13  4:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-10-03 15:49 Karl Eichwalder
2002-10-13  4:42 ` Jesper Harder [this message]
2002-10-14  4:05   ` Jesper Harder

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=m3elavlzjg.fsf@defun.localdomain \
    --to=harder@ifa.au.dk \
    /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.
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 NNTP newsgroup(s).