aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
Diffstat (limited to 'libsylph')
-rw-r--r--libsylph/prefs_common.c3
-rw-r--r--libsylph/prefs_common.h1
-rw-r--r--libsylph/procmime.c5
3 files changed, 7 insertions, 2 deletions
diff --git a/libsylph/prefs_common.c b/libsylph/prefs_common.c
index 3e258cd2..18dbecaa 100644
--- a/libsylph/prefs_common.c
+++ b/libsylph/prefs_common.c
@@ -244,6 +244,9 @@ static PrefParam param[] = {
{"resize_image", "TRUE", &prefs_common.resize_image, P_BOOL},
{"inline_image", "TRUE", &prefs_common.inline_image, P_BOOL},
+ {"fallback_encoding", CS_AUTO, &prefs_common.fallback_encoding,
+ P_STRING},
+
{"show_other_header", "FALSE", &prefs_common.show_other_header, P_BOOL},
/* MIME viewer */
diff --git a/libsylph/prefs_common.h b/libsylph/prefs_common.h
index 10eb1d46..a04d62da 100644
--- a/libsylph/prefs_common.h
+++ b/libsylph/prefs_common.h
@@ -173,6 +173,7 @@ struct _PrefsCommon
gboolean inline_image;
gchar *force_charset;
+ gchar *fallback_encoding;
gboolean show_other_header;
GSList *disphdr_list;
diff --git a/libsylph/procmime.c b/libsylph/procmime.c
index e9e53d6f..314a4eac 100644
--- a/libsylph/procmime.c
+++ b/libsylph/procmime.c
@@ -781,8 +781,9 @@ FILE *procmime_get_text_content(MimeInfo *mimeinfo, FILE *infp,
return NULL;
}
- src_encoding = prefs_common.force_charset
- ? prefs_common.force_charset : mimeinfo->charset;
+ src_encoding = prefs_common.force_charset ? prefs_common.force_charset
+ : mimeinfo->charset ? mimeinfo->charset
+ : prefs_common.fallback_encoding;
if (mimeinfo->mime_type == MIME_TEXT) {
while (fgets(buf, sizeof(buf), tmpfp) != NULL) {