2004-08-31 [colin] 0.9.12cvs84.3
[claws.git] / src / compose.c
index 5b5be8d24bf213faf65b86c5213427bc492a4d84..9a44a59cf5d691f9544641d4a076e425c94a8805 100644 (file)
@@ -2173,7 +2173,11 @@ static ComposeInsertResult compose_insert_file(Compose *compose, const gchar *fi
 
        while (fgets(buf, sizeof(buf), fp) != NULL) {
                const gchar *cur_encoding = conv_get_current_charset_str();
-               gchar *str = conv_codeset_strdup(buf, cur_encoding, CS_UTF_8);
+               gchar *str = NULL;
+               if (!g_utf8_validate(buf, -1, NULL))
+                       str = conv_codeset_strdup(buf, cur_encoding, CS_UTF_8);
+               else
+                       str = g_strdup(buf);
 
                if (!str) continue;