diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2008-12-11 03:55:49 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2008-12-11 03:55:49 +0000 |
commit | 1530b222bda57a53255e31784c0f3357a0af3829 (patch) | |
tree | 153e655314a9fbc694114743ffe1fddb78ace408 | |
parent | c846d3000225e4887948145bd7162e7e8a5af953 (diff) |
made a workaround for raw-JIS filename (Eudora etc.).
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2090 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | ChangeLog.ja | 5 | ||||
-rw-r--r-- | libsylph/procmime.c | 17 |
3 files changed, 27 insertions, 0 deletions
@@ -1,3 +1,8 @@ +2008-12-11 + + * libsylph/procmime.c: procmime_parse_mime_parameter(): made a + workaround for raw-JIS filename (Eudora etc.). + 2008-12-03 * libsylph/socket.[ch] diff --git a/ChangeLog.ja b/ChangeLog.ja index f8c02d5a..3d3592fe 100644 --- a/ChangeLog.ja +++ b/ChangeLog.ja @@ -1,3 +1,8 @@ +2008-12-11 + + * libsylph/procmime.c: procmime_parse_mime_parameter(): 生 JIS + ファイル名への対策を行った(Eudora 等)。 + 2008-12-03 * libsylph/socket.[ch] diff --git a/libsylph/procmime.c b/libsylph/procmime.c index a4de784d..10fc20e3 100644 --- a/libsylph/procmime.c +++ b/libsylph/procmime.c @@ -464,6 +464,8 @@ static gchar *procmime_convert_value(const gchar *value, const gchar *charset) static MimeParams *procmime_parse_mime_parameter(const gchar *str) { + ConvADType ad_type; + gchar *tmp = NULL; gchar *hvalue; gchar *param, *name, *value; gchar *charset = NULL, *lang = NULL; @@ -489,6 +491,19 @@ static MimeParams *procmime_parse_mime_parameter(const gchar *str) if (!p) return mparams; ++p; + + /* workaround for raw-JIS filename (Eudora etc.) */ + ad_type = conv_get_autodetect_type(); + if ((ad_type == C_AD_JAPANESE || + (ad_type == C_AD_BY_LOCALE && conv_is_ja_locale())) && + strstr(p, "\033$") != NULL) { + CodeConvFunc conv_func; + conv_func = conv_get_code_conv_func(NULL, NULL); + tmp = conv_func(p, NULL); + p = tmp; + debug_print("procmime_parse_mime_parameter(): raw-JIS header body detected: %s\n", str); + } + count = prev_count = -1; cont_name = cont_value = NULL; @@ -662,6 +677,8 @@ static MimeParams *procmime_parse_mime_parameter(const gchar *str) g_free(cont_value); g_free(lang); g_free(charset); + if (tmp) + g_free(tmp); plist = g_slist_reverse(plist); mparams->plist = plist; |