aboutsummaryrefslogtreecommitdiffstats
path: root/composer
diff options
context:
space:
mode:
authorJeffrey Stedfast <fejj@ximian.com>2003-03-05 02:31:35 +0800
committerJeffrey Stedfast <fejj@src.gnome.org>2003-03-05 02:31:35 +0800
commit4a28f62c6cfdfdd6867b899e8a742c719d8a41b4 (patch)
treefa10dd55d0ce2ac78cdc8c07819b3fb9e8452808 /composer
parentda7f62e15e131cf12066c0614ea470d75d1c1fc9 (diff)
downloadgsoc2013-evolution-4a28f62c6cfdfdd6867b899e8a742c719d8a41b4.tar
gsoc2013-evolution-4a28f62c6cfdfdd6867b899e8a742c719d8a41b4.tar.gz
gsoc2013-evolution-4a28f62c6cfdfdd6867b899e8a742c719d8a41b4.tar.bz2
gsoc2013-evolution-4a28f62c6cfdfdd6867b899e8a742c719d8a41b4.tar.lz
gsoc2013-evolution-4a28f62c6cfdfdd6867b899e8a742c719d8a41b4.tar.xz
gsoc2013-evolution-4a28f62c6cfdfdd6867b899e8a742c719d8a41b4.tar.zst
gsoc2013-evolution-4a28f62c6cfdfdd6867b899e8a742c719d8a41b4.zip
Don't allow the returned charset to be NULL. (get_file_content): Make sure
2003-03-04 Jeffrey Stedfast <fejj@ximian.com> * e-msg-composer.c (composer_get_default_charset_setting): Don't allow the returned charset to be NULL. (get_file_content): Make sure there is buffered data before trying to convert it to UTF-8. svn path=/trunk/; revision=20139
Diffstat (limited to 'composer')
-rw-r--r--composer/ChangeLog7
-rw-r--r--composer/e-msg-composer.c8
2 files changed, 13 insertions, 2 deletions
diff --git a/composer/ChangeLog b/composer/ChangeLog
index 38c818560a..994b747d6d 100644
--- a/composer/ChangeLog
+++ b/composer/ChangeLog
@@ -1,3 +1,10 @@
+2003-03-04 Jeffrey Stedfast <fejj@ximian.com>
+
+ * e-msg-composer.c (composer_get_default_charset_setting): Don't
+ allow the returned charset to be NULL.
+ (get_file_content): Make sure there is buffered data before trying
+ to convert it to UTF-8.
+
2003-03-04 Not Zed <NotZed@Ximian.com>
* e-msg-composer-hdrs.c (destroy): disconnect any signal handlers
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 25c54b86ce..a94a1f5b08 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -239,10 +239,14 @@ composer_get_default_charset_setting (void)
gconf = gconf_client_get_default ();
buf = gconf_client_get_string (gconf, "/apps/evolution/mail/composer/charset", NULL);
+
+ if (buf == NULL)
+ buf = gconf_client_get_string (gconf, "/apps/evolution/mail/format/charset", NULL);
+
charset = e_iconv_charset_name (buf);
g_free (buf);
- return charset;
+ return charset ? charset : "us-ascii";
}
static const char *
@@ -835,7 +839,7 @@ get_file_content (EMsgComposer *composer, const char *file_name, gboolean want_h
signature file that is in his/her locale charset. If it's not in UTF-8 and not in
the charset the composer is in (or their default mail charset) then fuck it,
there's nothing we can do. */
- if (!g_utf8_validate (buffer->data, buffer->len, NULL)) {
+ if (buffer->len && !g_utf8_validate (buffer->data, buffer->len, NULL)) {
stream = (CamelStream *) memstream;
memstream = (CamelStreamMem *) camel_stream_mem_new ();
camel_stream_mem_set_byte_array (memstream, g_byte_array_new ());