aboutsummaryrefslogtreecommitdiff
path: root/libsylph
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-11-01 08:08:05 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-11-01 08:08:05 +0000
commite2c282962d73d21414e6358aec97dc308199c3c8 (patch)
treed57f26242c57b07b6c3f5a681cad8cc0285c8c71 /libsylph
parenta9e6d3699d6072adb28956bcc8e31ebd501618f8 (diff)
added fallback encoding setting.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@702 ee746299-78ed-0310-b773-934348b2243d
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) {