Gnus development mailing list
 help / color / mirror / Atom feed
From: Andreas Schwab <schwab@linux-m68k.org>
To: bugs@gnus.org
Cc: Hobbit <werehobbit@yandex.ru>,  ding@gnus.org
Subject: Re: bug#8070: gnus damages attached file
Date: Sun, 20 Feb 2011 09:49:45 +0100	[thread overview]
Message-ID: <m262sfay52.fsf@whitebox.home> (raw)
In-Reply-To: <87ipwfo6as.fsf@gnus.org> (Lars Ingebrigtsen's message of "Sat, 19 Feb 2011 17:15:07 -0800")

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

Lars Ingebrigtsen <larsi@gnus.org> writes:

> Hobbit <werehobbit@yandex.ru> writes:
>
>> If you look at mml-generate-mime-1 at mml.el.gz, you'll see this code:
>>
>> (if (and (not raw)
>> 		   (member (car (split-string type "/")) '("text" "message")))
>> 	      (progn
>>
>> When attachment is text file all this black magic after `progn' starts
>> to work. Question arises: why not just grab a text, encode it into
>> base64 and put into a message?

You'll still have to find out the correct charset.

> It's a good question, and I don't know.  I've Cc'd this message to the
> Gnus development list -- perhaps someone there knows?
>
> (The issue is that the user inserts the following MIME part:
>
> ðóññêèé òåêñò â êï1251
>
>
> and then the CP<russian> text gets marked as utf-8.)

I see this in the raw mail:

--=-=-=
Content-Type: text/plain; charset=iso-8859-1
Content-Disposition: inline; filename=thing.txt
Content-Transfer-Encoding: base64

8PPx8ero6SDy5erx8iDiIOrvMTI1MQ0K
--=-=-=

Which makes sense, since 8-bit encodings cannot be told apart, so the
detection can't do better than using the first charset from the priority
list.  If you need to force a specific charset you have to specify it
manually, as I did here:


[-- Attachment #2: thing.txt --]
[-- Type: text/plain, Size: 24 bytes --]

русский текст в кп1251

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


Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

  reply	other threads:[~2011-02-20  8:49 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <871v34nwdn.fsf@myhost.localdomain>
     [not found] ` <87aahss3yu.fsf@gnus.org>
     [not found]   ` <87hbbz6fg4.fsf@myhost.localdomain>
     [not found]     ` <87vd0fpvzv.fsf@gnus.org>
     [not found]       ` <874o7z662d.fsf@myhost.localdomain>
     [not found]         ` <87d3mnk1sy.fsf@myhost.localdomain>
2011-02-20  1:15           ` Lars Ingebrigtsen
2011-02-20  8:49             ` Andreas Schwab [this message]
2011-02-20  9:23               ` Hobbit
2011-02-20  9:46                 ` Andreas Schwab
2011-02-20 10:46                   ` Hobbit
2011-02-20 11:40                     ` Andreas Schwab
2011-02-20 13:27                       ` Hobbit
2011-02-20 13:41                         ` Andreas Schwab
2011-02-20 14:03                           ` Hobbit
2011-02-20 14:17                             ` Andreas Schwab
2011-02-20 14:34                               ` Hobbit
2011-02-20 15:03                                 ` Andreas Schwab
2011-02-20 16:47                                   ` Hobbit
2011-02-20 14:38                               ` Hobbit
2011-02-20 15:04                                 ` Andreas Schwab
2011-02-20 15:25                               ` Hobbit
2011-02-20  9:31               ` Hobbit
2011-02-20  9:48                 ` Andreas Schwab

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=m262sfay52.fsf@whitebox.home \
    --to=schwab@linux-m68k.org \
    --cc=bugs@gnus.org \
    --cc=ding@gnus.org \
    --cc=werehobbit@yandex.ru \
    /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).