// Copyright (c) 1996-2022 by the citadel.org team
//
// This program is open source software. Use, duplication, or disclosure
-// are subject to the terms of the GNU General Public License v3.
+// is subject to the terms of the GNU General Public License v3.
#include <stdlib.h>
#include <errno.h>
#include <limits.h>
#include <iconv.h>
+#include <time.h>
#include "libcitadel.h"
-#if TIME_WITH_SYS_TIME
-# include <sys/time.h>
-# include <time.h>
-#endif
-
-
-// This is the non-define version in case it is needed for debugging
-#if 0
-inline void FindNextEnd (char *bptr, char *end) {
- /* Find the next ?Q? */
- end = strchr(bptr + 2, '?');
- if (end == NULL) return NULL;
- if (((*(end + 1) == 'B') || (*(end + 1) == 'Q')) &&
- (*(end + 2) == '?')) {
- /* skip on to the end of the cluster, the next ?= */
- end = strstr(end + 3, "?=");
- }
- else
- /* sort of half valid encoding, try to find an end. */
- end = strstr(bptr, "?=");
-}
-#endif
#define FindNextEnd(bptr, end) { \
end = strchr(bptr + 2, '?'); \
} \
}
+
// Handle subjects with RFC2047 encoding such as:
// =?koi8-r?B?78bP0s3Mxc7JxSDXz9rE1dvO2c3JINvB0sHNySDP?=
void utf8ify_rfc822_string(char *buf) {