aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-06-08 07:10:04 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2007-06-08 07:10:04 +0000
commitb14cba8ad5b13bccb3eff9e114407d542bc20409 (patch)
treecd69cbb9ce3c35f5dd26f617bb46f7d3449771f6
parent6d38a4176dfa949b59eb04299125018ed955f968 (diff)
supported UTF-8 with BOM when inserting signature.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@1754 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r--ChangeLog5
-rw-r--r--ChangeLog.ja4
-rw-r--r--src/compose.c40
3 files changed, 31 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 15f047ae..2077d0c5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2007-06-08
+
+ * src/compose.c: compose_get_signature_str(): supported UTF-8 with
+ BOM.
+
2007-06-07
* libsylph/session.c: session_ping_cb(): abort if not connected.
diff --git a/ChangeLog.ja b/ChangeLog.ja
index 51b841fd..12addf86 100644
--- a/ChangeLog.ja
+++ b/ChangeLog.ja
@@ -1,3 +1,7 @@
+2007-06-08
+
+ * src/compose.c: compose_get_signature_str(): BOM 付き UTF-8 に対応。
+
2007-06-07
* libsylph/session.c: session_ping_cb(): 接続されていない場合は中断
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;
}