[Evolution] Character encoding and expunge?
Not Zed
notzed@ximian.com
Mon, 24 May 2004 19:13:34 +0800
--=-6yGU9bOwgFrcy1Oc9aLx
Content-Type: multipart/related; type="multipart/alternative"; boundary="=-hyJ86agZvJbMxxbaQyNW"
--=-hyJ86agZvJbMxxbaQyNW
Content-Type: multipart/alternative; boundary="=-Uwhkun8gPD/iK+uzzeZe"
--=-Uwhkun8gPD/iK+uzzeZe
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
This patch is completely untested apart from it compiling with no
warnings. It wont be committed if someone can't get off their lazy bum
and at least test it. And fix it up to an acceptable level if it needs
fixing. You might have to read rfc2047 to make it work/test it too,
since it needs to work properly with valid emails.
I wont be spending any more time on this until someone else does (and
Jeff, don't touch it!), and if they don't, I guess nobody cares enough
do they?
On Mon, 2004-05-24 at 04:42 +0800, cantona wrote:
> Hi,
>
> See
> http://bugzilla.ximian.com/show_bug.cgi?id=58555
> http://bugzilla.ximian.com/show_bug.cgi?id=58691
>
> Anyway, I asked someone that he said since there are mainly mailer
> parsed the mistake encoding so it must also a pressure to Evolution to
> maintain the decoding to the broken encode-word.
>
> Regards,
> Cantona
>
> On Sun, 2004-05-23 at 21:17 +0200, Bjørn T Johansen wrote:
> > Hi..
> >
> > I have been using Evolution awhile but lately I have been using
> > Thunderbird because of two things that annoys me about Evolution.
> > And I have just downloaded the latest development snapshot for SuSE 9.1
> > but sadly, the two things are still there...
> >
> > Mainly, evol. doesn't show every mail correctly regarding character
> > enconding.. Some mail looks like this..:
> >
> > Subject:
> > Hva som skal st=?ISO-8859-1?B?5Q==?=
> > I mail som sendes u
> >
> > Why isn't this shown like this ??:
> >
> > Subject: Hva som skal stå I mail som sendes u
> >
> >
> > This works like charm with both thunderbird and also kmail.
> >
> >
> > Second, why isn't there an option that make it possible to enable "hard"
> > delete of mail instead of delete and then have to press Ctrl-E to
> > expunge the mail. This should be a small task to implement, the code is
> > already there, just combine it... :)
> >
> >
> > And also, when using IMAP, why isn't the seen flag marked when I have
> > read the email? I have to eg. go to another folder en back again to make
> > sure the mail is marked as read..
> >
> >
> > I must say that I really like Evolution and I like the look of the new
> > 2.0 version but until these things are fixed, thunderbird is my game...
> >
> >
> > Regards,
> >
> > BTJ
> >
>
> _______________________________________________
> evolution maillist - evolution@lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/evolution
Michael Zucchi
<notzed@ximian.com>
Ximian Evolution and
Free Software Developer
Novell, Inc.
--=-Uwhkun8gPD/iK+uzzeZe
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 7bit
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.1.14">
</HEAD>
<BODY>
<BR>
This patch is completely untested apart from it compiling with no warnings. It wont be committed if someone can't get off their lazy bum and at least test it. <B>And</B> fix it up to an acceptable level if it needs fixing. You might have to read rfc2047 to make it work/test it too, since it needs to work properly with valid emails.<BR>
<BR>
I wont be spending any more time on this until someone else does (and Jeff, don't touch it!), and if they don't, I guess nobody cares enough do they?<BR>
<BR>
On Mon, 2004-05-24 at 04:42 +0800, cantona wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
<FONT COLOR="#000000">Hi, </FONT>
<FONT COLOR="#000000">See</FONT>
<FONT COLOR="#000000"><A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=58555">http://bugzilla.ximian.com/show_bug.cgi?id=58555</A></FONT>
<FONT COLOR="#000000"><A HREF="http://bugzilla.ximian.com/show_bug.cgi?id=58691">http://bugzilla.ximian.com/show_bug.cgi?id=58691</A></FONT>
<FONT COLOR="#000000">Anyway, I asked someone that he said since there are mainly mailer</FONT>
<FONT COLOR="#000000">parsed the mistake encoding so it must also a pressure to Evolution to</FONT>
<FONT COLOR="#000000">maintain the decoding to the broken encode-word.</FONT>
<FONT COLOR="#000000">Regards, </FONT>
<FONT COLOR="#000000">Cantona</FONT>
<FONT COLOR="#000000">On Sun, 2004-05-23 at 21:17 +0200, Bjørn T Johansen wrote:</FONT>
<FONT COLOR="#000000">> Hi..</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> I have been using Evolution awhile but lately I have been using</FONT>
<FONT COLOR="#000000">> Thunderbird because of two things that annoys me about Evolution.</FONT>
<FONT COLOR="#000000">> And I have just downloaded the latest development snapshot for SuSE 9.1</FONT>
<FONT COLOR="#000000">> but sadly, the two things are still there...</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> Mainly, evol. doesn't show every mail correctly regarding character</FONT>
<FONT COLOR="#000000">> enconding.. Some mail looks like this..:</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> Subject: </FONT>
<FONT COLOR="#000000">> Hva som skal st=?ISO-8859-1?B?5Q==?=</FONT>
<FONT COLOR="#000000">> I mail som sendes u</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> Why isn't this shown like this ??:</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> Subject: Hva som skal stå I mail som sendes u</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> This works like charm with both thunderbird and also kmail.</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> Second, why isn't there an option that make it possible to enable "hard"</FONT>
<FONT COLOR="#000000">> delete of mail instead of delete and then have to press Ctrl-E to</FONT>
<FONT COLOR="#000000">> expunge the mail. This should be a small task to implement, the code is</FONT>
<FONT COLOR="#000000">> already there, just combine it... :)</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> And also, when using IMAP, why isn't the seen flag marked when I have</FONT>
<FONT COLOR="#000000">> read the email? I have to eg. go to another folder en back again to make</FONT>
<FONT COLOR="#000000">> sure the mail is marked as read..</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> I must say that I really like Evolution and I like the look of the new</FONT>
<FONT COLOR="#000000">> 2.0 version but until these things are fixed, thunderbird is my game...</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> Regards,</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">> BTJ</FONT>
<FONT COLOR="#000000">> </FONT>
<FONT COLOR="#000000">_______________________________________________</FONT>
<FONT COLOR="#000000">evolution maillist - <A HREF="mailto:evolution@lists.ximian.com">evolution@lists.ximian.com</A></FONT>
<FONT COLOR="#000000"><A HREF="http://lists.ximian.com/mailman/listinfo/evolution">http://lists.ximian.com/mailman/listinfo/evolution</A></FONT>
</PRE>
</BLOCKQUOTE>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<TABLE BGCOLOR="#eb0000" CELLSPACING="6" CELLPADDING="6" WIDTH="100%">
<TR>
<TD BGCOLOR="#ffffff">
<IMG SRC="cid:1085396457.2020.0.camel@localhost.localdomain" WIDTH="48" HEIGHT="48" ALIGN="top" ALT="" BORDER="0">
</TD>
<TD BGCOLOR="#ffffff" WIDTH="100%">
<B>Michael Zucchi</B> <<A HREF="mailto:notzed@ximian.com">notzed@ximian.com</A>><BR>
<BR>
<I><A HREF="http://codeblogs.ximian.com/blogs/evolution/">Ximian Evolution</A> and <A HREF="http://www.gnu.org/philosophy/free-sw.html">Free Software</A> Developer</I>
</TD>
<TD BGCOLOR="#ffffff" NOWRAP>
<BR>
<BR>
<B><A HREF="http://www.novell.com/">Novell, Inc.</A></B>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>
--=-Uwhkun8gPD/iK+uzzeZe--
--=-hyJ86agZvJbMxxbaQyNW
Content-ID: <1085396457.2020.0.camel@localhost.localdomain>
Content-Disposition: attachment; filename=zed-48.small.jpg
Content-Type: image/jpeg; name=zed-48.small.jpg
Content-Transfer-Encoding: base64
/9j/4AAQSkZJRgABAQEASABIAAD/2wBDAA0JCgsKCA0LCgsODg0PEyAVExISEyccHhcgLikxMC4p
LSwzOko+MzZGNywtQFdBRkxOUlNSMj5aYVpQYEpRUk//2wBDAQ4ODhMREyYVFSZPNS01T09PT09P
T09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT0//wAARCAAwADADASIA
AhEBAxEB/8QAGQAAAwEBAQAAAAAAAAAAAAAAAwQFAgYB/8QALhAAAgEDAgUEAQIHAAAAAAAAAQID
BBEhABIFEzFBURQigZEGYXE0UmJyobHx/8QAFwEBAQEBAAAAAAAAAAAAAAAABAMCAf/EAB0RAAID
AQEAAwAAAAAAAAAAAAABAgMREjEiMkH/2gAMAwEAAhEDEQA/AK8sEEq35nLaP3e1cW/m8kfdtAfh
824L7I1YFrnaRt8+L40U1ECxiGjLzSCocRYuQhubW7jIxrcFZRzU7q3sh3e8deWvX67/AKX0Xegi
TixevoZdxjhnkk2xBj2Z7DIA74Gs+kgpoaamPLllqE5yPuO4i1+nix7+NS3qatikPNZa+idmjLGx
YE+7r16DHgnTEtRWTVIraiknUrE42mJvYTY/IyfjT66YZjNzkzSSRTrEYTuz0tbpg6oV1V62op5G
3QhV9yn+7t8DXPDiZlaepq0AYIBGEFtuRc2/WwH7aroXho98jNG5RVa4wDYNbzqNsefqdcnmM0J0
pp1kKyRywsdpU46EX/19aT4ioWgmanATG0Mpvcd89750arjMg2L1DfQtnSixTMW5hO0ZBZsEg5t5
xodU+8fhit7jZz4ChQWS99U1lC0H8RNZx74xK2DkAG48ePOtU0UUsQLC6kki/wC+jqtMpeLapjYg
XJyNLcxyr1EUHaWaEspHXPbXVcNkUcCUOjvNv2kAdAehOkVo4LrDEFG9hcnPe+rlUsNNSenUIWkk
ZHfbflqFC475IvqdnyWaRsgl6MNwysp13y8uLG3cTk6LBwCmliFR6lw7XBKdMdj50t+X8RkWOnhV
rbnLfX/dUPx1ivAoTJnmFm+CdIVEIx6XpFQSZxVVH6KrkRRaAudn9I8HXhniSPcyC/ntqzxOjMNS
6uNyMbqT0I1Ogoad6pF5S23C4t1zqOa8Y7xbEDSxmesguHDId4DKQDjGqMqHmNLGygFnujAZF8DF
820/xYpQ8RWcRLtkBINuh6Ef5B0tNRH0L7UEjGzCVTZirDBGfJ+NasrcMf4CnLp6f//Z
--=-hyJ86agZvJbMxxbaQyNW--
--=-6yGU9bOwgFrcy1Oc9aLx
Content-Disposition: attachment; filename=58555.diff
Content-Type: text/x-patch; name=58555.diff; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
Index: camel/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.2146
diff -u -3 -r1.2146 ChangeLog
--- camel/ChangeLog 24 May 2004 08:02:10 -0000 1.2146
+++ camel/ChangeLog 24 May 2004 11:18:50 -0000
@@ -1,5 +1,11 @@
2004-05-24 Not Zed <NotZed@Ximian.com>
+ * camel-mime-utils.c (header_decode_text): Crap interoperability
+ fix for a crap interoperability problem with BROKEN emailers.
+ Totally untested. See #58555.
+
+2004-05-24 Not Zed <NotZed@Ximian.com>
+
* camel-mime-utils.c (camel_header_newsgroups_decode):
fix/rearrange logic. It was using the wrong working pointer.
Index: camel/camel-mime-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-mime-utils.c,v
retrieving revision 1.208
diff -u -3 -r1.208 camel-mime-utils.c
--- camel/camel-mime-utils.c 24 May 2004 08:02:10 -0000 1.208
+++ camel/camel-mime-utils.c 24 May 2004 11:18:52 -0000
@@ -1147,18 +1147,38 @@
while (inptr < inend && !camel_mime_is_lwsp(*inptr))
inptr++;
- dword = rfc2047_decode_word(start, inptr-start);
- if (dword) {
- g_string_append(out, dword);
- g_free(dword);
- } else {
+ /* interofuxedability fix for non rfc compliant i18n mailers */
+ do {
+ const char *enc, *end;
+
+ enc = strstr(start, "=?");
+ if (enc
+ && enc < inptr) {
+ if (enc == start
+ && (end = strstr(enc+2, "?="))
+ && end < (inptr-2)
+ && (dword = rfc2047_decode_word(start, end-start+2))) {
+ g_string_append(out, dword);
+ g_free(dword);
+ start = end + 2;
+ chunk = start;
+ continue;
+ } else {
+ end = enc;
+ }
+ } else {
+ end = inptr;
+ }
+
if (!chunk)
chunk = start;
- if ((default_charset == NULL || !append_8bit (out, chunk, inptr-chunk, default_charset))
- && (locale_charset == NULL || !append_8bit(out, chunk, inptr-chunk, locale_charset)))
- append_latin1(out, chunk, inptr-chunk);
- }
+ if ((default_charset == NULL || !append_8bit (out, chunk, end-chunk, default_charset))
+ && (locale_charset == NULL || !append_8bit(out, chunk, end-chunk, locale_charset)))
+ append_latin1(out, chunk, end-chunk);
+
+ start = end;
+ } while (start < inptr);
chunk = NULL;
}
--=-6yGU9bOwgFrcy1Oc9aLx--