Gnus development mailing list
 help / color / mirror / Atom feed
From: Hobbit <werehobbit@yandex.ru>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: bugs@gnus.org,  ding@gnus.org
Subject: Re: bug#8070: gnus damages attached file
Date: Sun, 20 Feb 2011 15:27:12 +0200	[thread overview]
Message-ID: <874o7yeszz.fsf@myhost.localdomain> (raw)
In-Reply-To: <m2hbbz9bo4.fsf@igel.home> (Andreas Schwab's message of "Sun, 20 Feb 2011 12:40:27 +0100")

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

Andreas Schwab <schwab@linux-m68k.org> writes:

>>
>> Because almost all of my work recepients use Windows and expect only
>> CP1251.
>
> How is that an argument against specifying the correct charset
> explicitly?
>

I can't know charset of everything. If somebody ask me to send him some
cryptic text file (for example, generated by an old local program with
it's own unique charset), I don't want to guess what codepage it
has. Asked. Sent. Finished.

Today I had to pack it into a ZIP archive to ensure integrity.

At least it could be better to specify it by some variable (setq
gnus-default-attachment-charset ...) separately.

>> So 98 % cases my recepients know what they are going to view.
>
> What about the remaining 2%?
>

Well, in a such cases I usually write about codepage in a message
text. I would be happy to use something like

<menu-bar> <Set Attachment Codepage> 
Codepage: adobe-standard-encoding-dos (or "don't specify" if needed)

to explicitly ask Gnus for that. But in 98 % it's just a problem.  And
yes, I usually use Linux and prefer UTF8 for my own Org-Mode notes and
other.

>> Introducing some Gnus ability for other 2 % just create unnecesary
>> problems.
>
> Which problems?
>
Look news://news.gnus.org/gnus.gnus-bug thread 'bug#8070: gnus damages
attached file'

I enclose two reports about that (from aforementioned thread):


[-- Attachment #2: report #1 --]
[-- Type: text/plain, Size: 1950 bytes --]

From: Werehobbit <werehobbit@yandex.ru>
Subject: bug#8070: gnus damages attached file
Newsgroups: gnus.gnus-bug
Date: Thu, 17 Feb 2011 09:09:42 +0200
Organization: Gnus News User Services

Gnus v5.13
GNU Emacs 23.2.1 (i686-pc-linux-gnu, GTK+ Version 2.20.1)
 of 2010-05-08 on pidsley.hoetzel.info

Gnus damages an attached text file (i. e. if you send file your
recipient will recieve it in broken state).

I attached example files: original text file (in CP1251)
letter.txt.orig and received file letter.txt, everything packed in ZIP archive.

Sorry for my broken English.

------------------ Environment follows ------------------

(setq gnus-default-nntp-server "")
(setq gnus-select-method
      '(nnml ""))
(setq gnus-summary-mode-hook
      '(gnus-agent-mode))
(setq gnus-exit-gnus-hook
      '(mm-destroy-postponed-undisplay-list))
(setq gnus-setup-news-hook
      '(gnus-agent-queue-setup gnus-fixup-nnimap-unread-after-getting-new-news))
(setq gnus-group-mode-hook
      '(gnus-agent-mode))
;; (makeunbound 'gnus-topic-mode)
;; (makeunbound 'gnus-topic-mode-hook)
;; (makeunbound 'gnus-topic-line-format)
;; (makeunbound 'gnus-topic-indent-level)
;; (makeunbound 'gnus-topic-display-empty-topics)
(setq gnus-server-mode-hook
      '(gnus-agent-mode))
(setq mm-charset-synonym-alist
      '((ibm866 . cp866)
        (unicode . utf-16-le)
        (ks_c_5601-1987 . cp949)
        (windows-31j . cp932)
        (utf8 . utf-8)
        (iso8859-1 . iso-8859-1)
        (iso_8859-1 . iso-8859-1)))
(setq message-send-mail-function 'smtpmail-send-it)
(setq message-mode-hook
      '(#[nil "\302\030\303	!)\207"
              [gnus-article-copy gnus-setup-message-group nil gnus-configure-posting-styles]
              2]
        #[nil "\302 \211\020\211\021\207"
              [message-mailer message-newsreader gnus-extended-version]
              2]))
(setq message-header-setup-hook
      '(gnus-inews-insert-archive-gcc gnus-inews-insert-gcc))

[-- Attachment #3: zip-archive from report1 --]
[-- Type: application/zip, Size: 407 bytes --]

[-- Attachment #4: report #2 --]
[-- Type: text/plain, Size: 2343 bytes --]

From: "Evgeny M. Zubok" <evgeny.zubok@tochka.ru>
Subject: Re: bug#8070: gnus damages attached file
Newsgroups: gnus.gnus-bug
Date: Sun, 20 Feb 2011 13:41:40 +0300
Organization: Gnus News User Services


I can confirm this strange behaviour. Gnus converts attachments from
8-bit coding system like cp1251 (viewing it as iso-8859-1 text) to
utf-8. It seems to occur only with files that have MIME supertype
"text". When I send README.doc with plain unibyte text in cp1251
simultaneously as "text/plain" (or "text/x-tex" for instance) and
"application/msword" (or "application/octet-stream") it received
differently:

as "text/plain", "text/x-tex", etc.

-rw-r--r-- 1 zubok zubok  9 Фев 20 12:56 README.doc
-rw------- 1 zubok zubok 17 Фев 20 12:58 README1.doc.received
                        ^^^
Raw mail:

Content-Type: text/plain; charset=utf-8
Content-Disposition: attachment; filename=README.doc
Content-Transfer-Encoding: base64


as "application/msword", "application/octet-stream"

-rw-r--r-- 1 zubok zubok 9 Фев 20 12:56 README.doc
-rw------- 1 zubok zubok 9 Фев 20 12:58 README2.doc.received
                        ^^^
Raw mail:

Content-Type: application/msword
Content-Disposition: attachment; filename=README.doc
Content-Transfer-Encoding: base64


Additional information
======================

Emacs 22.2.1, Gnus 5.11. Both from Debian.

The variable mm-coding-system-priorities is nil by default.

Relevant settings from ~/.emacs:

(set-language-environment 'utf-8)
(set-terminal-coding-system 'utf-8)
(set-keyboard-coding-system 'utf-8)
(set-selection-coding-system 'compound-text)
(setq x-select-request-type '(UTF8_STRING COMPOUND_TEXT TEXT STRING))

(codepage-setup 1251)
(codepage-setup 866)
(define-coding-system-alias 'ibm866 'cp866)
(define-coding-system-alias 'windows-1251 'cp1251)
(define-coding-system-alias 'koi8-u 'koi8-r)
(define-coding-system-alias 'utf8 'utf-8)

Locale settings:

$ locale
LANG=ru_RU.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=


  reply	other threads:[~2011-02-20 13:27 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
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 [this message]
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=874o7yeszz.fsf@myhost.localdomain \
    --to=werehobbit@yandex.ru \
    --cc=bugs@gnus.org \
    --cc=ding@gnus.org \
    --cc=schwab@linux-m68k.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.
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).