Re: [evolution-patches] newest patch for fix non rfc2047 compliant i18n mailer



FIXED another case like
"=?Big5?B?t1Gw3aazw+Swpm1vdXNlpm6k4rdQPyAop9qwpqTitFikaqRVKSAu?==?Big5?B?Li4=?="

I promise I have tested all cases that this patch is working fine

On Wed, 2004-06-02 at 18:00 +0800, cantona wrote:
> Hi, 
> 
> This is the newest patch. Working with no overhead and no broken the
> valid header. Check this attached patch and please ignore my old post of
> the patch.
> 
> Thanks,
> Cantona
? camel/test.c
? shell/shell-errors.xml.h
Index: camel/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/camel/ChangeLog,v
retrieving revision 1.2153
diff -u -r1.2153 ChangeLog
--- a/camel/ChangeLog	1 Jun 2004 03:40:24 -0000	1.2153
+++ b/camel/ChangeLog	2 Jun 2004 10:38:53 -0000
@@ -1,3 +1,8 @@
+2004-06-02  Cantona Su  <paradisetux hotmail com>
+
+	* camel-mime-utils.c (header_decode_text):
+	Fix non rfc2047 compliant i18n mailer. See #58555
+	 
 2004-05-31  Jeffrey Stedfast  <fejj ximian com>
 
 	* camel-mime-filter-gzip.c (camel_mime_filter_gzip_finalize):
Index: camel/camel-mime-utils.c
===================================================================
RCS file: /cvs/gnome/evolution/camel/camel-mime-utils.c,v
retrieving revision 1.208
diff -u -r1.208 camel-mime-utils.c
--- a/camel/camel-mime-utils.c	24 May 2004 08:02:10 -0000	1.208
+++ b/camel/camel-mime-utils.c	2 Jun 2004 10:38:55 -0000
@@ -69,7 +69,7 @@
 /* for all non-essential warnings ... */
 #define w(x)
 
-#define d(x)
+#define d(x) 
 #define d2(x)
 
 #define CAMEL_UUENCODE_CHAR(c)  ((c) ? (c) + ' ' : '`')
@@ -1142,12 +1142,38 @@
 		} else {
 			chunk = start;
 		}
-
+		
 		start = inptr;
-		while (inptr < inend && !camel_mime_is_lwsp(*inptr))
-			inptr++;
-
+		
+		/* Fix non rfc2047 compliant i18n mailer */	
+		if (!(*inptr == '=' && *(inptr+1) == '?')) {
+			while (inptr < inend && !camel_mime_is_lwsp(*inptr) 
+				&& !(*(inptr) == '=' && *(inptr+1) == '?'))
+			{
+				inptr++;
+			}
+		} else if (strstr(start, "=?") && inptr < inend) {
+			
+			if (strstr(start, "?B?") || strstr(start, "?b?")) {
+				if (strstr(start+1, "?=")) {
+					inptr = strstr(start+1, "?=") + 2;
+				} else {
+					inptr = inend;
+				}
+			} else if (strstr(start, "?Q?") || strstr(start, "?q?")) {
+				if (strstr(start+1, "=?")) {
+					inptr = strstr(start+1, "=?");
+				} else {
+					inptr =inend;
+				}
+			}
+			
+			while (!(*(inptr-1) == '=' && *(inptr-2) == '?'))
+				inptr--;
+		}
+		
 		dword = rfc2047_decode_word(start, inptr-start);
+		
 		if (dword) {
 			g_string_append(out, dword);
 			g_free(dword);
@@ -1171,7 +1197,7 @@
 
 char *
 camel_header_decode_string (const char *in, const char *default_charset)
-{
+{	
 	if (in == NULL)
 		return NULL;
 	return header_decode_text (in, strlen (in), default_charset);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]