diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-06-08 07:10:04 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2007-06-08 07:10:04 +0000 |
commit | b14cba8ad5b13bccb3eff9e114407d542bc20409 (patch) | |
tree | cd69cbb9ce3c35f5dd26f617bb46f7d3449771f6 /src | |
parent | 6d38a4176dfa949b59eb04299125018ed955f968 (diff) |
supported UTF-8 with BOM when inserting signature.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1754 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r-- | src/compose.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/src/compose.c b/src/compose.c index 34e3a1f1..1724e9b9 100644 --- a/src/compose.c +++ b/src/compose.c @@ -1866,6 +1866,7 @@ static gchar *compose_get_signature_str(Compose *compose) { gchar *sig_path; gchar *sig_body = NULL; + gchar *utf8_sig_body = NULL; gchar *sig_str = NULL; gchar *utf8_sig_str = NULL; @@ -1936,29 +1937,32 @@ static gchar *compose_get_signature_str(Compose *compose) } g_free(sig_path); - if (prefs_common.sig_sep) { - sig_str = g_strconcat(prefs_common.sig_sep, "\n", sig_body, - NULL); - g_free(sig_body); - } else - sig_str = sig_body; - - if (sig_str) { + if (sig_body) { gint error = 0; - utf8_sig_str = conv_codeset_strdup_full - (sig_str, conv_get_locale_charset_str(), + utf8_sig_body = conv_codeset_strdup_full + (sig_body, conv_get_locale_charset_str(), CS_INTERNAL, &error); - if (!utf8_sig_str || error != 0) { - if (g_utf8_validate(sig_str, -1, NULL) == TRUE) { - g_free(utf8_sig_str); - utf8_sig_str = sig_str; - } else - g_free(sig_str); - } else - g_free(sig_str); + if (!utf8_sig_body || error != 0) { + if (g_utf8_validate(sig_body, -1, NULL) == TRUE) { + g_free(utf8_sig_body); + utf8_sig_body = conv_utf8todisp(sig_body, NULL); + } + } else { + g_free(sig_body); + sig_body = utf8_sig_body; + utf8_sig_body = conv_utf8todisp(sig_body, NULL); + } + g_free(sig_body); } + if (prefs_common.sig_sep) { + utf8_sig_str = g_strconcat(prefs_common.sig_sep, "\n", + utf8_sig_body, NULL); + g_free(utf8_sig_body); + } else + utf8_sig_str = utf8_sig_body; + return utf8_sig_str; } |