+void procmime_scan_content_description(MimeInfo *mimeinfo,
+ const gchar *content_description)
+{
+ gchar *buf;
+
+ gchar *tmp;
+ size_t blen;
+
+ if (conv_get_current_charset() == C_EUC_JP &&
+ strchr(content_description, '\033')) {
+ gint len;
+ len = strlen(content_description) * 2 + 1;
+ Xalloca(buf, len, return);
+ conv_jistoeuc(buf, len, content_description);
+ } else
+ Xstrdup_a(buf, content_description, return);
+
+ blen = strlen(buf) + 1;
+ Xalloca(tmp, blen, return);
+ conv_unmime_header(tmp, blen, buf, NULL);
+ g_free(mimeinfo->name);
+ mimeinfo->name = NULL;
+ /*pgp signatures should NOT have a name */
+ if (mimeinfo->content_type
+ && strcasecmp(mimeinfo->content_type, "application/pgp-signature"))
+ mimeinfo->name = g_strdup(tmp);
+}
+
+void procmime_scan_subject(MimeInfo *mimeinfo,
+ const gchar *subject)
+{
+ gchar *buf;
+
+ gchar *tmp;
+ size_t blen;
+
+ if (conv_get_current_charset() == C_EUC_JP &&
+ strchr(subject, '\033')) {
+ gint len;
+ len = strlen(subject) * 2 + 1;
+ Xalloca(buf, len, return);
+ conv_jistoeuc(buf, len, subject);
+ } else
+ Xstrdup_a(buf, subject, return);
+
+ blen = strlen(buf) + 1;
+ Xalloca(tmp, blen, return);
+ conv_unmime_header(tmp, blen, buf, NULL);
+ g_free(mimeinfo->name);
+ mimeinfo->name = g_strdup(tmp);
+}
+