view src/lib-charset/charset-utf8.h @ 608:debb8468514e HEAD

SEARCH CHARSET now works properly with message bodies, and in general body searching works more correctly by decoding base64/qp data. Non-text MIME parts are currently not included in search, that could be made optional. Also the body is parsed separately for each keyword, that could be optimized. Changed base64_decode() behaviour so that it can accept non-base64 data as well, ie. line feeds etc.
author Timo Sirainen <tss@iki.fi>
date Wed, 13 Nov 2002 13:08:18 +0200
parents f2aa58c2afd0
children 553f050c8313
line wrap: on
line source

#ifndef __CHARSET_UTF8_H
#define __CHARSET_UTF8_H

typedef struct _CharsetTranslation CharsetTranslation;

/* Begin translation to UTF-8. */
CharsetTranslation *charset_to_utf8_begin(const char *charset,
					  int *unknown_charset);

void charset_to_utf8_end(CharsetTranslation *t);

void charset_to_utf8_reset(CharsetTranslation *t);

/* Convert inbuf to UTF-8. inbuf and inbuf_size is updated to specify beginning
   of data that was not written to outbuf, either because of inbuf ended with
   incomplete character sequence or because the outbuf got full. Returns TRUE
   if no conversion errors were detected. */
int charset_to_ucase_utf8(CharsetTranslation *t,
			  const unsigned char **inbuf, size_t *insize,
			  unsigned char *outbuf, size_t *outsize);

/* Simple wrapper for above functions. size is updated to strlen() of
   returned UTF-8 string. */
const char *
charset_to_ucase_utf8_string(const char *charset, int *unknown_charset,
			     const unsigned char *buf, size_t *size);

#endif