commit 46a8a5c02498c1a886aa2242ef5438ca7cc017cf
parent 7a6741a86ca4c8e5dde64862a9db6bb7a2e0113a
Author: Christoph Lohmann <20h@r-36.net>
Date: Thu, 2 Aug 2012 16:35:26 +0200
Reenabling old header decoding. Default header is not the right solution.
Diffstat:
4 files changed, 7 insertions(+), 35 deletions(-)
diff --git a/mime.c b/mime.c
@@ -296,25 +296,6 @@ mime_decodeheader(char *value)
}
char *
-mime_decodeheaderdefault(char *value, char *charset)
-{
- char *ret, *rdec;
-
- ret = mime_decodeheader(value);
- if (ret != NULL) {
- if (strcasecmp(charset, "utf-8") && !strcmp(value, ret)) {
- rdec = mime_iconv(ret, charset, "UTF-8");
- if (rdec != NULL) {
- free(ret);
- ret = rdec;
- }
- }
- }
-
- return ret;
-}
-
-char *
mime_decodeparam(char *value)
{
char *work, *cret, *ret, *cs, *str, *lang;
diff --git a/mime.h b/mime.h
@@ -36,7 +36,6 @@ char *mime_iconv(char *str, char *from, char *to);
char *mime_decodeheaderext(char *value);
int mime_isextws(char *str, int len);
char *mime_decodeheader(char *value);
-char *mime_decodeheaderdefault(char *value, char *charset);
char *mime_decodeparam(char *value);
char *mime_encodestring(char *value);
char *mime_encodeheader(char *header, char *value);
diff --git a/scan.c b/scan.c
@@ -93,9 +93,7 @@ scanmain(int argc, char *argv[])
frome = llist_ciget(mime->hdrs, "from");
if (subjecte != NULL) {
- subject = mime_decodeheaderdefault(
- (char *)subjecte->data,
- mime->charset);
+ subject = mime_decodeheader((char *)subjecte->data);
} else {
subject = "<empty>";
}
@@ -112,9 +110,7 @@ scanmain(int argc, char *argv[])
}
if (frome != NULL) {
- from = mime_decodeheaderdefault(
- (char *)frome->data,
- mime->charset);
+ from = mime_decodeheader((char *)frome->data);
} else {
from = "<empty>";
}
@@ -169,9 +165,7 @@ scanmain(int argc, char *argv[])
id = (char *)ide->data;
if (subjecte != NULL) {
- subject = mime_decodeheaderdefault(
- (char *)subjecte->data,
- mime->charset);
+ subject = mime_decodeheader((char *)subjecte->data);
} else {
subject = "<empty>";
}
@@ -188,9 +182,7 @@ scanmain(int argc, char *argv[])
}
if (frome != NULL) {
- from = mime_decodeheaderdefault(
- (char *)frome->data,
- mime->charset);
+ from = mime_decodeheader((char *)frome->data);
} else {
from = "<empty>";
}
diff --git a/view.c b/view.c
@@ -141,7 +141,7 @@ view_printpart(char *id, mime_t *mime, llist_t *dhdrs, llist_t *partl,
didprint = 0;
if (!strcasecmp(dhdrs->first->key, "all")) {
forllist(mime->hdrs, helem) {
- hvalue = mime_decodeheaderdefault((char *)helem->data, mime->charset);
+ hvalue = mime_decodeheader((char *)helem->data);
if (hvalue == NULL)
continue;
if (options & PRINT_VALUE) {
@@ -157,8 +157,8 @@ view_printpart(char *id, mime_t *mime, llist_t *dhdrs, llist_t *partl,
hlist = llist_cifind(mime->hdrs, delem->key);
if (hlist != NULL) {
forllist(hlist, helem) {
- hvalue = mime_decodeheaderdefault(
- (char *)helem->data, mime->charset);
+ hvalue = mime_decodeheader(
+ (char *)helem->data);
if (hvalue == NULL)
continue;
if (options & PRINT_VALUE) {