From: Reiner Steib <reinersteib+gmane@imap.cc>
To: ding@gnus.org
Subject: Re: More liberal MIME decoding (unencoded question marks in encoded words)
Date: Sat, 01 Dec 2007 14:17:36 +0100 [thread overview]
Message-ID: <v9ve7ia70v.fsf@marauder.physik.uni-ulm.de> (raw)
In-Reply-To: <b4m7ik4jaln.fsf@jpl.org>
On Tue, Nov 27 2007, Katsumi Yamaoka wrote:
>>>>>> Reiner Steib wrote:
>> On Mon, Nov 26 2007, Katsumi Yamaoka wrote:
>>> Would we be able to make complete test cases?
I don't think providing *complete* test cases is possible. But
regression tests would be very nice to have.
How about defining a variable containing list of (decoded . encoded)
pairs, decode/encode the strings and put the results in a buffer (or
file) and compare them?
[...]
>> +\\|Q\\?\\(?:\\?+[ -<>@-~]\\)?\\(?:[ ->@-~]+\\?+[ -<>@-~]\\)*[ ->@-~]*\\?*\
>> +\\)\\?="))
>
> This pattern is similar to:
>
> "Q\\?\\(\\?+[^\n=?]\\)?\\([^\n?]+\\?+[^\n=?]\\)*[^\n?]*\\?*"
> <--------1-------><----------2,3----------><--4--><-5->
>
> 1. After "Q?", allow "?"s that follow a character other than "=".
> 2. Allow "=" after "Q?"; it isn't regarded as the terminator.
> 3. In the middle of an encoded word, allow "?"s that follow a
> character other than "=".
> 4. Allow any characters other than "?" in the middle of an
> encoded word.
> 5. At the end, allow "?"s.
Could you please add such explanations as comments in `rfc2047.el'?
>> And we probably should have an option to toggle strict/loose
>> decoding.
>
> I've introduced the `rfc2047-allow-irregular-q-encoded-words'
> option. I wish that it is tested widely, so I've set the default
> value to t. But it might have to be nil when it is imported into
> the stable branch.
I see that we already have quite a few of these variables: At least
`rfc2047-allow-irregular-q-encoded-words',
`rfc2047-allow-incomplete-encoded-text' and finally
`gnus-article-loose-mime'.
How about deriving the defaults from a single variable
`rfc2047-allow-loose-mime' (or `rfc2047-loose-mime-decoding'):
(defcustom rfc2047-allow-loose-mime t
"Allow loose MIME decoding. ...")
(devar rfc2047-allow-irregular-q-encoded-words rfc2047-allow-loose-mime
...)
(devar rfc2047-allow-incomplete-encoded-text rfc2047-allow-loose-mime
...)
(defcustom gnus-article-loose-mime rfc2047-allow-loose-mime
"...
See also `rfc2047-allow-loose-mime'.")
Or even, if we don't need such a fine tuning, use
`rfc2047-allow-loose-mime' directly.
> Now there are two regexps; one is `rfc2047-encoded-word-regexp' for
> strict decoding, the other is `rfc2047-encoded-word-regexp-loose'.
You you explain the purpose of using `eval-and-compile'?
> I agree with you. I've made `rfc2047-encodable-p' use
> `rfc2047-encoded-word-regexp' instead of "=?".
The defconst needs to be before `rfc2047-encodable-p':
In rfc2047-encodable-p:
rfc2047.el:302:37:Warning: reference to free variable
`rfc2047-encoded-word-regexp'
> It will be hard to be found out even if this change causes another
> trouble, though.
Yes.
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
next prev parent reply other threads:[~2007-12-01 13:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-24 13:29 Reiner Steib
2007-11-26 12:31 ` Katsumi Yamaoka
2007-11-26 22:08 ` Reiner Steib
2007-11-27 9:34 ` Katsumi Yamaoka
2007-12-01 13:17 ` Reiner Steib [this message]
2007-12-04 9:19 ` Katsumi Yamaoka
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=v9ve7ia70v.fsf@marauder.physik.uni-ulm.de \
--to=reinersteib+gmane@imap.cc \
--cc=Reiner.Steib@gmx.de \
--cc=ding@gnus.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).