message-header-decode.c revision 72388282bf6718c39af34cfcf51438910f9d62da
/* Copyright (C) 2002-2007 Timo Sirainen */
#include "lib.h"
#include "base64.h"
#include "buffer.h"
#include "charset-utf8.h"
#include "quoted-printable.h"
#include "message-header-decode.h"
static size_t
{
#define QCOUNT 3
unsigned int num = 0;
/* data should contain "charset?encoding?text?=" */
for (i = 0; i < size; i++) {
if (data[i] == '?') {
break;
}
}
/* invalid block */
return 0;
}
case 'q':
case 'Q':
break;
case 'b':
case 'B':
/* contains invalid data. show what we got so far. */
}
break;
default:
/* unknown encoding */
return 0;
}
}
void *context)
{
unsigned int charsetlen = 0;
/* =?charset?Q|B?text?= */
t_push();
pos++;
continue;
}
/* encoded string beginning */
/* send the unencoded data so far */
break;
}
}
} else {
}
pos += 2;
decodebuf, &charsetlen);
/* decodebuf contains <charset> NUL <text> */
break;
}
}
}
}
t_pop();
}
struct decode_utf8_context {
bool ucase;
};
static bool
{
struct charset_translation *t;
bool unknown_charset;
/* ASCII / UTF-8 */
} else {
}
return TRUE;
}
if (unknown_charset) {
/* let's just ignore this part */
return TRUE;
}
/* ignore any errors */
charset_to_utf8_end(&t);
return TRUE;
}
{
struct decode_utf8_context ctx;
}