[evolution-patches] 300115, camel, rfc2047 encoding last char split unecessarily



make check passes with this installed, the logic is too hairy to
validate visually

Index: camel/ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/ChangeLog,v
retrieving revision 1.2462
diff -u -p -r1.2462 ChangeLog
--- camel/ChangeLog	9 Aug 2005 04:02:32 -0000	1.2462
+++ camel/ChangeLog	9 Aug 2005 05:07:23 -0000
@@ -1,3 +1,11 @@
+2005-08-09  Changwoo Ryu <cwryu debian org>
+
+	** See bug #300115.
+
+	* camel-mime-utils.c (rfc2047_encode_word): if the last unicode
+	character in the input string is non-ASCII, it is always encoded
+	as a separated chunk.
+
 2005-08-08  Not Zed  <NotZed Ximian com>
 
 	** See bug #312831.
Index: camel/camel-mime-utils.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/camel/camel-mime-utils.c,v
retrieving revision 1.230
diff -u -p -r1.230 camel-mime-utils.c
--- camel/camel-mime-utils.c	18 May 2005 16:52:00 -0000	1.230
+++ camel/camel-mime-utils.c	9 Aug 2005 05:07:24 -0000
@@ -1316,7 +1316,7 @@ rfc2047_encode_word(GString *outstring, 
 			/* proclen will be the result of input characters that we can convert, to the nearest
 			   (approximated) valid utf8 char */
 			convlen = 0;
-			proclen = 0;
+			proclen = -1;
 			p = inptr;
 			i = 0;
 			while (p < (in+len) && convlen < (75 - strlen("=?utf-8?q\?\?="))) {
@@ -1332,8 +1332,10 @@ rfc2047_encode_word(GString *outstring, 
 				else
 					convlen += 3;
 			}
+			if (proclen >= 0 && proclen < i && convlen < (75 - strlen("=?utf-8?q\?\?=")))
+				proclen = i;
 			/* well, we probably have broken utf8, just copy it anyway what the heck */
-			if (proclen == 0) {
+			if (proclen == -1) {
 				w(g_warning("Appear to have truncated utf8 sequence"));
 				proclen = inlen;
 			}


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