n = convert_string (u, ulen, "UTF-8", t, &s, &slen);
n = convert_string (u, ulen, fromcode, t, &s, &slen);
static char *choose_charset (const char *charsets, char *u, size_t ulen){  char *tocode = 0;  size_t bestn = 0;  const char *p, *q;  for (p = charsets; p; p = q ? q + 1 : 0)  {    char *s, *t;    size_t slen, n;    q = strchr (p, ':');    n = q ? q - p : strlen (p);    if (!n ||	/* Assume that we never need more than 12 characters of	   encoded-text to encode a single character. */	n > (ENCWORD_LEN_MAX - ENCWORD_LEN_MIN + 2 - 12))      continue;    t = safe_malloc (n + 1);    memcpy (t, p, n), t[n] = '\0';    n = convert_string (u, ulen, "UTF-8", t, &s, &slen);    if (n == (size_t)(-1))      continue;    free (s);    if (!tocode || n < bestn)    {      free (tocode), tocode = t, bestn = n;      if (!bestn)	break;    }    else      free (t);  }  return tocode;}