From cd0112576878cb5de3930835ff09f1562e9f5c10 Mon Sep 17 00:00:00 2001 From: David Liang Date: Mon, 31 Aug 2009 13:07:00 +0200 Subject: Bug #494531 - Use quoted-printable encoding when necessary For example when part body contains a line longer than some max. --- composer/e-msg-composer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 1b2d5c665c..02e5db7acd 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -283,7 +283,7 @@ best_encoding (GByteArray *buf, const gchar *charset) if (status == (gsize) -1 || status > 0) return -1; - if (count == 0) + if ((count == 0) && (buf->len < LINE_LEN)) return CAMEL_TRANSFER_ENCODING_7BIT; else if (count <= buf->len * 0.17) return CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE; @@ -703,6 +703,7 @@ build_message (EMsgComposer *composer, part = camel_mime_part_new (); camel_medium_set_content_object (CAMEL_MEDIUM (part), html); camel_object_unref (html); + camel_mime_part_set_encoding (part, CAMEL_TRANSFER_ENCODING_QUOTEDPRINTABLE); camel_multipart_add_part (body, part); camel_object_unref (part); -- cgit v1.2.3