* [PATCH] workaround non ascii chars in rfc2231
@ 2005-11-22 13:43 Pixel
2005-11-24 4:26 ` Katsumi Yamaoka
0 siblings, 1 reply; 5+ messages in thread
From: Pixel @ 2005-11-22 13:43 UTC (permalink / raw)
[-- Attachment #1: Type: text/plain, Size: 375 bytes --]
hi,
i've received a mail having: "Content-Disposition: attachment; filename=fêtesxxxxxx.pdf",
and so that part was considered text/plain.
with the following patch, it works. It's quite simple: since
forward-sexp stop at first 8-bit char, i simply retry.
a better (??) patch would be to modify the syntax table?
i attach a simple mail containing the pb
cu
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gnus-workaround-non-ascii-chars-in-rfc2231.patch --]
[-- Type: text/x-patch, Size: 783 bytes --]
Index: lisp/rfc2231.el
===================================================================
RCS file: /usr/local/cvsroot/gnus/lisp/rfc2231.el,v
retrieving revision 7.6
diff -u -r7.6 rfc2231.el
--- lisp/rfc2231.el 28 Jul 2005 02:05:21 -0000 7.6
+++ lisp/rfc2231.el 22 Nov 2005 11:41:09 -0000
@@ -127,7 +127,13 @@
(> c ?\177)) ;; EXTENSION: Support non-ascii chars.
(not (memq c stoken)))
(setq value (buffer-substring
- (point) (progn (forward-sexp) (point)))))
+ (point)
+ (progn (forward-sexp)
+ ;; EXTENSION: Support non-ascii chars.
+ (while (and (not (eobp))
+ (> (char-after) ?\177))
+ (forward-char 1) (forward-sexp))
+ (point)))))
(t
(error "Invalid header: %s" string)))
(if number
[-- Attachment #3: zz --]
[-- Type: application/octet-stream, Size: 2688 bytes --]
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] workaround non ascii chars in rfc2231
2005-11-22 13:43 [PATCH] workaround non ascii chars in rfc2231 Pixel
@ 2005-11-24 4:26 ` Katsumi Yamaoka
2005-11-24 20:13 ` Reiner Steib
0 siblings, 1 reply; 5+ messages in thread
From: Katsumi Yamaoka @ 2005-11-24 4:26 UTC (permalink / raw)
Cc: ding
>>>>> In <lymzjw6bnr.fsf@leia.mandriva.com> Pixel wrote:
> i've received a mail having:
> "Content-Disposition: attachment; filename=fêtesxxxxxx.pdf",
> and so that part was considered text/plain.
> with the following patch, it works. It's quite simple: since
> forward-sexp stop at first 8-bit char, i simply retry.
Confirmed. I've applied your patch to the trunk and the v5-10
branch. Thanks.
> a better (??) patch would be to modify the syntax table?
I don't know, but I'm reluctant to support such broken mails
further.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] workaround non ascii chars in rfc2231
2005-11-24 4:26 ` Katsumi Yamaoka
@ 2005-11-24 20:13 ` Reiner Steib
2005-11-24 21:08 ` Pascal (Pixel) Rigaux
0 siblings, 1 reply; 5+ messages in thread
From: Reiner Steib @ 2005-11-24 20:13 UTC (permalink / raw)
On Thu, Nov 24 2005, Katsumi Yamaoka wrote:
>>>>>> In <lymzjw6bnr.fsf@leia.mandriva.com> Pixel wrote:
>
>> i've received a mail having:
>> "Content-Disposition: attachment; filename=fêtesxxxxxx.pdf",
>> and so that part was considered text/plain.
>
>> with the following patch, it works. It's quite simple: since
>> forward-sexp stop at first 8-bit char, i simply retry.
>
> Confirmed. I've applied your patch to the trunk and the v5-10
> branch. Thanks.
We should have a real name instead of "Pixel" in the ChangeLog (even
if it a tiny patch):
,----
| +2005-11-24 Pixel <pixel@mandriva.com> (tiny change)
| +
| + * rfc2231.el (rfc2231-parse-string): Support non-ascii chars.
| +
`----
> I don't know, but I'm reluctant to support such broken mails
> further.
If it is incorrect, we should probably add a more appropriate comment
instead of "EXTENSION: Support non-ascii chars.".
Bye, Reiner.
--
,,,
(o o)
---ooO-(_)-Ooo--- | PGP key available | http://rsteib.home.pages.de/
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] workaround non ascii chars in rfc2231
2005-11-24 20:13 ` Reiner Steib
@ 2005-11-24 21:08 ` Pascal (Pixel) Rigaux
2005-11-24 23:01 ` Katsumi Yamaoka
0 siblings, 1 reply; 5+ messages in thread
From: Pascal (Pixel) Rigaux @ 2005-11-24 21:08 UTC (permalink / raw)
Reiner Steib <reinersteib+gmane@imap.cc> writes:
> We should have a real name instead of "Pixel" in the ChangeLog (even
> if it a tiny patch):
>
> ,----
> | +2005-11-24 Pixel <pixel@mandriva.com> (tiny change)
> | +
> | + * rfc2231.el (rfc2231-parse-string): Support non-ascii chars.
a more "real" name could be Pascal Rigaux <pixel@mandriva.com> :)
cu
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] workaround non ascii chars in rfc2231
2005-11-24 21:08 ` Pascal (Pixel) Rigaux
@ 2005-11-24 23:01 ` Katsumi Yamaoka
0 siblings, 0 replies; 5+ messages in thread
From: Katsumi Yamaoka @ 2005-11-24 23:01 UTC (permalink / raw)
>>>>> In <ly64qhkb3g.fsf@leia.mandriva.com> Pascal (Pixel) Rigaux wrote:
> a more "real" name could be Pascal Rigaux <pixel@mandriva.com> :)
Fixed.
>>>>> In <v9oe494xef.fsf@marauder.physik.uni-ulm.de> Reiner Steib wrote:
> If it is incorrect, we should probably add a more appropriate comment
> instead of "EXTENSION: Support non-ascii chars.".
Done.
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2005-11-24 23:01 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-11-22 13:43 [PATCH] workaround non ascii chars in rfc2231 Pixel
2005-11-24 4:26 ` Katsumi Yamaoka
2005-11-24 20:13 ` Reiner Steib
2005-11-24 21:08 ` Pascal (Pixel) Rigaux
2005-11-24 23:01 ` Katsumi Yamaoka
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).