charset-iconv.c revision 305898aa452b74cbc3aa335c00e876768e9a6910
/* Copyright (C) 2002 Timo Sirainen */
#include "lib.h"
#include "charset-utf8.h"
#ifdef HAVE_ICONV_H
#include <iconv.h>
#include <ctype.h>
#ifdef __sun__
# define ICONV_CONST const
#else
# define ICONV_CONST
#endif
struct _CharsetTranslation {
int ascii;
};
int *unknown_charset)
{
int ascii;
if (unknown_charset != NULL)
*unknown_charset = FALSE;
} else {
if (unknown_charset != NULL)
*unknown_charset = TRUE;
return NULL;
}
}
return t;
}
void charset_to_utf8_end(CharsetTranslation *t)
{
iconv_close(t->cd);
i_free(t);
}
void charset_to_utf8_reset(CharsetTranslation *t)
{
}
{
ICONV_CONST char *ic_inbuf;
char *ic_outbuf;
/* no translation needed - just copy it to outbuf uppercased */
for (i = 0; i < max_size; i++)
*insize = 0;
return TRUE;
}
/* should be EILSEQ - invalid input */
return FALSE;
}
}
for (i = 0; i < max_size; i++)
return TRUE;
}
const char *
{
ICONV_CONST char *inbuf;
}
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;
}
*outpos++ = '\0';
return outbuf;
}
#endif