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



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 09:51:07 -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 09:51:09 -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,36 @@
 		} 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, "=?=") + 3; 
+				} else {
+					inptr = strstr(start+1, "=?");
+				}
+			} else if (strstr(start, "?Q?") || strstr(start, "?q?")) {
+				inptr = strstr(start+1, "=?");
+			}
+			
+			if (!inptr)
+				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 +1195,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]