charset-iconv.c revision da8d7157eb6fbff7e88712516548c7fab2ebe9f2
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "buffer.h"
#include "charset-utf8.h"
#ifdef HAVE_ICONV
#include <iconv.h>
#include <ctype.h>
struct charset_translation {
bool ascii;
};
bool *unknown_charset)
{
struct charset_translation *t;
bool ascii;
if (unknown_charset != NULL)
*unknown_charset = FALSE;
} else {
if (unknown_charset != NULL)
*unknown_charset = TRUE;
return NULL;
}
}
return t;
}
{
struct charset_translation *t = *_t;
iconv_close(t->cd);
i_free(t);
}
void charset_to_utf8_reset(struct charset_translation *t)
{
}
enum charset_result
charset_to_ucase_utf8(struct charset_translation *t,
{
ICONV_CONST char *ic_srcbuf;
char *ic_destbuf;
enum charset_result ret;
/* no translation needed - just copy it to outbuf uppercased */
return CHARSET_RET_OK;
}
else {
/* should be EILSEQ */
return CHARSET_RET_INVALID_INPUT;
}
/* give back the memory we didn't use */
return ret;
}
enum charset_result
charset_to_ucase_utf8_full(struct charset_translation *t,
{
enum charset_result ret;
for (pos = 0;;) {
if (ret != CHARSET_RET_OUTPUT_FULL) {
return ret;
}
/* force buffer to grow */
}
}
static const char *
{
ICONV_CONST char *inbuf;
if (unknown_charset != NULL)
*unknown_charset = FALSE;
if (!ucase) {
if (utf8_size_r != NULL)
*utf8_size_r = size;
}
}
if (unknown_charset != NULL)
*unknown_charset = TRUE;
return NULL;
}
if (unknown_charset != NULL)
*unknown_charset = FALSE;
/* invalid data */
return NULL;
}
/* output buffer too small, grow it */
outsize *= 2;
}
if (utf8_size_r != NULL)
*outpos++ = '\0';
if (ucase)
return outbuf;
}
const char *
{
}
const char *
{
}
#endif