aboutsummaryrefslogtreecommitdiffstats
path: root/composer/e-msg-composer.c
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@helixcode.com>2000-09-29 06:12:23 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2000-09-29 06:12:23 +0800
commitc540870b0c5653363a06cf17fab33b7ffff49e78 (patch)
tree320034a7380e10db2c004d6bdbf460ca58aa8021 /composer/e-msg-composer.c
parentbb1d28d7c566e36e916a7fa3fe8e973223c2d96f (diff)
downloadgsoc2013-evolution-c540870b0c5653363a06cf17fab33b7ffff49e78.tar
gsoc2013-evolution-c540870b0c5653363a06cf17fab33b7ffff49e78.tar.gz
gsoc2013-evolution-c540870b0c5653363a06cf17fab33b7ffff49e78.tar.bz2
gsoc2013-evolution-c540870b0c5653363a06cf17fab33b7ffff49e78.tar.lz
gsoc2013-evolution-c540870b0c5653363a06cf17fab33b7ffff49e78.tar.xz
gsoc2013-evolution-c540870b0c5653363a06cf17fab33b7ffff49e78.tar.zst
gsoc2013-evolution-c540870b0c5653363a06cf17fab33b7ffff49e78.zip
Check to see if the body has 8bit chars, if so - set the
2000-09-28 Jeffrey Stedfast <fejj@helixcode.com> * e-msg-composer.c (build_message): Check to see if the body has 8bit chars, if so - set the Content-Transfer-Encoding to 8bit. Addresses Bugzilla bug #652. svn path=/trunk/; revision=5623
Diffstat (limited to 'composer/e-msg-composer.c')
-rw-r--r--composer/e-msg-composer.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 6173070676..1d191c8e25 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -186,6 +186,18 @@ typedef enum {
MSG_FORMAT_ALTERNATIVE,
} MsgFormat;
+static gboolean
+is_8bit (guchar *text)
+{
+ guchar *c;
+
+ for (c = text; *c; c++)
+ if (*c > (guchar) 127)
+ return TRUE;
+
+ return FALSE;
+}
+
/* This functions builds a CamelMimeMessage for the message that the user has
composed in `composer'. */
static CamelMimeMessage *
@@ -198,6 +210,7 @@ build_message (EMsgComposer *composer)
CamelMultipart *body = NULL;
CamelMimePart *part;
gchar *from = NULL;
+ gboolean e8bit;
char *html = NULL, *plain = NULL, *fmt = NULL;
int i;
@@ -234,6 +247,7 @@ build_message (EMsgComposer *composer)
}
plain = get_text (composer->persist_stream_interface, "text/plain");
+ e8bit = is_8bit (plain);
fmt = format_text (plain);
g_free (plain);
@@ -248,6 +262,9 @@ build_message (EMsgComposer *composer)
part = camel_mime_part_new ();
camel_mime_part_set_content (part, fmt, strlen (fmt), "text/plain");
+ if (e8bit)
+ camel_mime_part_set_encoding (part, CAMEL_MIME_PART_ENCODING_8BIT);
+
g_free (fmt);
camel_multipart_add_part (body, part);
camel_object_unref (CAMEL_OBJECT (part));
@@ -274,7 +291,9 @@ build_message (EMsgComposer *composer)
break;
case MSG_FORMAT_PLAIN:
camel_mime_part_set_content (part, fmt, strlen (fmt), "text/plain");
- g_free(fmt);
+ if (e8bit)
+ camel_mime_part_set_encoding (part, CAMEL_MIME_PART_ENCODING_8BIT);
+ g_free (fmt);
break;
}
camel_multipart_add_part (multipart, part);