oldout = dup(1);
dup2(fileno(outfp), 1);
-
+
p = popen(renderer->renderer, "w");
if (p != NULL) {
size_t count;
gchar *charset, *lang, *oldvalue, *newvalue;
attribute = (gchar *) cur->data;
- if (!g_hash_table_lookup_extended(table, attribute, (gpointer *) &key, (gpointer *) &value))
+ if (!g_hash_table_lookup_extended(
+ table, attribute, (gpointer *)(gchar *) &key, (gpointer *)(gchar *) &value))
continue;
charset = value;
mimeinfo->type = MIMETYPE_TEXT;
mimeinfo->subtype = g_strdup("plain");
if (g_hash_table_lookup(mimeinfo->typeparameters,
- "charset") == NULL)
- g_hash_table_insert(mimeinfo->typeparameters,
+ "charset") == NULL) {
+ if (strcmp(conv_get_locale_charset_str(), CS_UTF_8))
+ g_hash_table_insert(mimeinfo->typeparameters,
+ g_strdup("charset"),
+ g_strdup(conv_get_locale_charset_str()));
+ else
+ g_hash_table_insert(mimeinfo->typeparameters,
g_strdup("charset"),
- g_strdup("us-ascii"));
+ g_strdup(CS_ISO_8859_1));
+ }
} else {
gchar *type, *subtype, *params;
mimeinfo->type = MIMETYPE_TEXT;
mimeinfo->subtype = g_strdup("plain");
if (g_hash_table_lookup(mimeinfo->typeparameters,
- "charset") == NULL)
- g_hash_table_insert(mimeinfo->typeparameters, g_strdup("charset"), g_strdup("us-ascii"));
+ "charset") == NULL) {
+ if (strcmp(conv_get_locale_charset_str(), CS_UTF_8))
+ g_hash_table_insert(mimeinfo->typeparameters,
+ g_strdup("charset"),
+ g_strdup(conv_get_locale_charset_str()));
+ else
+ g_hash_table_insert(mimeinfo->typeparameters,
+ g_strdup("charset"),
+ g_strdup(CS_ISO_8859_1));
+ }
}
if (content_encoding != NULL) {
debug_print("procmime_write_mimeinfo\n");
- if (mimeinfo->encoding_type == ENC_UNKNOWN
- && mimeinfo->content != MIMECONTENT_EMPTY)
- procmime_encode_content(mimeinfo, ENC_BINARY);
-
if (G_NODE_IS_LEAF(mimeinfo->node)) {
switch (mimeinfo->content) {
case MIMECONTENT_FILE:
/* Call writer for mime type */
switch (mimeinfo->type) {
case MIMETYPE_MESSAGE:
- if (g_ascii_strcasecmp(mimeinfo->subtype, "rfc822") == 0)
+ if (g_ascii_strcasecmp(mimeinfo->subtype, "rfc822") == 0) {
return procmime_write_message_rfc822(mimeinfo, fp);
+ }
break;
case MIMETYPE_MULTIPART: