aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-07-11 09:44:55 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-07-11 09:44:55 +0000
commit42f57024627723df2a5221436022982d68662e20 (patch)
tree3243779b08f1a0b56b112b5baf6181eebc8f2a0f /src
parentce4ea6da4ec2b2b88f7b9b03f94c5d859be4ef1b (diff)
compose.c: don't convert encoding if inserted file is UTF-8.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@418 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src')
-rw-r--r--src/compose.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/compose.c b/src/compose.c
index 0f5abb1a..767b17dd 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -1696,9 +1696,14 @@ static gchar *compose_get_signature_str(Compose *compose)
sig_str = sig_body;
if (sig_str) {
- utf8_sig_str = conv_codeset_strdup
- (sig_str, conv_get_locale_charset_str(), CS_INTERNAL);
- g_free(sig_str);
+ if (g_utf8_validate(sig_str, -1, NULL) == TRUE)
+ utf8_sig_str = sig_str;
+ else {
+ utf8_sig_str = conv_codeset_strdup
+ (sig_str, conv_get_locale_charset_str(),
+ CS_INTERNAL);
+ g_free(sig_str);
+ }
}
return utf8_sig_str;
@@ -1736,7 +1741,11 @@ static void compose_insert_file(Compose *compose, const gchar *file,
while (fgets(buf, sizeof(buf), fp) != NULL) {
gchar *str;
- str = conv_codeset_strdup(buf, cur_encoding, CS_INTERNAL);
+ if (g_utf8_validate(buf, -1, NULL) == TRUE)
+ str = g_strdup(buf);
+ else
+ str = conv_codeset_strdup
+ (buf, cur_encoding, CS_INTERNAL);
if (!str) continue;
/* strip <CR> if DOS/Windows file,