[balsa] use utf-8 for both plain and html parts



commit 74799b94c166b2e601fe13d7d6b0f80686e811ff
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date:   Wed Apr 29 08:23:21 2009 -0400

    use utf-8 for both plain and html parts
    
    (bsmsg2message): when sending both text/plain and text/html parts, use
    UTF-8 encoding for both parts, to accommodate some brain-damaged MUAs
    that mix up the encodings; fixes bug #580704, reported by
    ildar users sourceforge net.
---
 src/sendmsg-window.c |   10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diff --git a/src/sendmsg-window.c b/src/sendmsg-window.c
index 986b4a6..0e75ff7 100644
--- a/src/sendmsg-window.c
+++ b/src/sendmsg-window.c
@@ -5506,7 +5506,15 @@ bsmsg2message(BalsaSendmsg * bsmsg)
     sw_buffer_set_undo(bsmsg, FALSE, FALSE);
 #endif                          /* HAVE_GTKSOURCEVIEW */
 
-    body->charset = g_strdup(sw_required_charset(bsmsg, body->buffer));
+    /* Ildar reports that, when a message contains both text/plain and
+     * text/html parts, some broken MUAs use the charset from the
+     * text/plain part to display the text/html part; the latter is
+     * encoded as UTF-8 by add_mime_body_plain (send.c), so we'll use
+     * the same encoding for the text/plain part.
+     * http://bugzilla.gnome.org/show_bug.cgi?id=580704 */
+    body->charset =
+        g_strdup(bsmsg->send_mp_alt ?
+                 "UTF-8" : sw_required_charset(bsmsg, body->buffer));
     libbalsa_message_append_part(message, body);
 
     /* add attachments */



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