X-Git-Url: http://git.marmaro.de/?a=blobdiff_plain;f=sbr%2Ffmt_rfc2047.c;h=4e8231fc417327ad5e9f72449da12c7d2aab69fb;hb=10e03b3fba3e01052baf92c963c46a2a5529b4e0;hp=dc123e53fd8f177facabe633e5544aeb1782e35b;hpb=714b5c530ece27ea2835a313013f5b770163403c;p=mmh diff --git a/sbr/fmt_rfc2047.c b/sbr/fmt_rfc2047.c index dc123e5..4e8231f 100644 --- a/sbr/fmt_rfc2047.c +++ b/sbr/fmt_rfc2047.c @@ -125,22 +125,25 @@ decode_rfc2047(char *str, char *dst, size_t dstlen) if (!*pp) continue; + *pp = '\0'; /* Check if character set can be handled natively */ - if (!check_charset(startofmime, pp - startofmime)) { + if (!is_native_charset(startofmime)) { #ifdef HAVE_ICONV /* .. it can't. We'll use iconv then. */ - *pp = '\0'; cd = iconv_open(get_charset(), startofmime); fromutf8 = !mh_strcasecmp(startofmime, "UTF-8"); *pp = '?'; - if (cd == (iconv_t)-1) continue; + if (cd == (iconv_t)-1) + continue; use_iconv = 1; #else + *pp = '?'; continue; #endif } + *pp = '?'; startofmime = pp + 1; /* Check for valid encoding type */