diff options
-rw-r--r-- | composer/ChangeLog | 7 | ||||
-rw-r--r-- | composer/e-msg-composer.c | 8 |
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 ()); |