Gnus development mailing list
 help / color / mirror / Atom feed
From: TSUCHIYA Masatoshi <tsuchiya@namazu.org>
Cc: semi-gnus-ja@meadowy.org
Subject: Case of letters that specify encodings in MIME-encoded words
Date: Mon, 10 May 2004 15:15:49 +0900	[thread overview]
Message-ID: <87fza84xka.fsf@pine.kuee.kyoto-u.ac.jp> (raw)

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

Hi,

I noticed that several MUAs (including Microsoft Outlook Express) fail
to decode MIME-encoded subjects which are composed with Gnus.  In
order to check the detail of this problem, I send three mails that
have MIME-encoded subjects to my friend who uses Microsoft Outlook
Express, and ask him to check whether these subjects are successfully
decoded or not.  The result is here:

        MIME-encoded subject field      |   Result
  --------------------------------------+-------------
    =?iso-2022-jp?b?GyRCNEE7ehsoQg==?=  |  undecoded
    =?iso-2022-jp?B?GyRCNEE7ehsoQg==?=  |   decoded
    =?ISO-2022-JP?B?GyRCNEE7ehsoQg==?=  |   decoded

This result shows that this broken decoder decodes MIME-encoded words
whose encodings are specified in the uppercase letter "B", and shows
that it does not decode a word whose encoding is specified in the
lowercase letter "b".

I think that a careless programmer implemented this decoder reading
the fourth section of RFC2047,

   4. Encodings
      Initially, the legal values for "encoding" are "Q" and "B".

and he/she failed to notice the second section.

   2. Syntax of encoded-words

        encoded-word = "=?" charset "?" encoding "?" encoded-text "?="
        charset = token    ; see section 3
        encoding = token   ; see section 4

      Both 'encoding' and 'charset' names are case-independent.  Thus
      the charset name "ISO-8859-1" is equivalent to "iso-8859-1", and
      the encoding named "Q" may be spelled either "Q" or "q".

It is true that my reporting problem is not caused by Gnus, but I
think that the attached change may be useful for Gnus users who are
forced to communicate with users of such broken MUAs, and that it is
not harmful to Gnus at least.

Can I commit this change?

--
TSUCHIYA Masatoshi

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: Type: text/x-patch, Size: 389 bytes --]

--- rfc2047.el	7 Apr 2004 19:41:45 -0000	7.11
+++ rfc2047.el	7 May 2004 09:07:53 -0000
@@ -406,7 +406,7 @@
 			   'Q))))
 	 (start (concat
 		 "=?" (downcase (symbol-name mime-charset)) "?"
-		 (downcase (symbol-name encoding)) "?"))
+		 (upcase (symbol-name encoding)) "?"))
 	 (factor (case mime-charset
 		   ((iso-8859-5 iso-8859-7 iso-8859-8 koi8-r) 1)
 		   ((big5 gb2312 euc-kr) 2)

             reply	other threads:[~2004-05-10  6:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-10  6:15 TSUCHIYA Masatoshi [this message]
2004-05-10  7:34 ` Katsumi Yamaoka
2004-05-12 17:39 ` TSUCHIYA Masatoshi

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=87fza84xka.fsf@pine.kuee.kyoto-u.ac.jp \
    --to=tsuchiya@namazu.org \
    --cc=semi-gnus-ja@meadowy.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).