#endif
const char *eptr;
int passes = 0;
- int i, len, delta;
+ int i, len;
int illegal_non_rfc2047_encoding = 0;
/* Sometimes, badly formed messages contain strings which were simply
(*ptr == '\n') ||
(*ptr == '\t')))
ptr ++;
- /* did we find a gab just filled with blanks? */
- if (ptr == next)
+ /*
+ * did we find a gab just filled with blanks?
+ * if not, copy its stuff over.
+ */
+ if (ptr != next)
{
- long gap = next - start;
- memmove (end + 2,
- next,
- len - (gap));
- len -= gap;
- /* now terminate the gab at the end */
- delta = (next - end) - 2; ////TODO: const!
- ((StrBuf*)DecodeMee)->BufUsed -= delta;
- ((StrBuf*)DecodeMee)->buf[DecodeMee->BufUsed] = '\0';
-
- /* move next to its new location. */
- next -= delta;
- nextend -= delta;
+ StrBufAppendBufPlain(Target,
+ end + 2,
+ next - end - 2,
+ 0);
}
}
/* our next-pair is our new first pair now. */
FreeStrBuf(&Target);
FreeStrBuf(&FoundCharset);
FreeStrBuf(&DefaultCharset);
+
+
+ DefaultCharset = NewStrBufPlain(HKEY("iso-8859-1"));
+ FoundCharset = NewStrBuf();
+ Source = NewStrBufPlain(HKEY("\"w.goesgens\" <w.goesgens@aoeuaoeuaoeu.org>, =?ISO-8859-15?Q?Walter_?= =?ISO-8859-15?Q?G=F6aoeus?= <aoeuaoeu@aoe.de>, =?ISO-8859-15?Q?aoeuaoeuh?= =?ISO-8859-15?Q?_G=F6aoeus?= <aoeuoeuaoeu@oeu.de>, aoeuao aoeuaoeu <aoeuaoeuaoeaoe@aoe.de"));
+ Target = NewStrBufPlain(NULL, 256);
+
+ StrBuf_RFC822_to_Utf8(Target, Source, DefaultCharset, FoundCharset);
+ TestRevalidateStrBuf(Target);
+ printf("the ugly multi:>%s<\n", ChrPtr(Target));
+ FreeStrBuf(&Source);
+ FreeStrBuf(&Target);
+ FreeStrBuf(&FoundCharset);
+ FreeStrBuf(&DefaultCharset);
+
}