mutt_decode_utf8_string (uid, _chs);
if (_chs && (cd = iconv_open (_chs, "utf-8")) != (iconv_t)-1) { int n = s - uid + 1;  char *buf; const char *ib; char *ob; size_t ibl, obl;  buf = safe_malloc (n+1); ib = uid, ibl = d - uid + 1, ob = buf, obl = n; iconv (cd, &ib, &ibl, &ob, &obl); if (!ibl) { if (ob-buf < n) { memcpy (uid, buf, ob-buf); uid[ob-buf] = '\0'; } else if (ob-buf == n && (buf[n] = 0, strlen (buf) < n)) memcpy (uid, buf, n); } free (buf); iconv_close (cd); }
static void fix_uid (char *uid){  char *s, *d;    for (s = d = uid; *s;)  {    if (*s == '\\' && *(s+1) == 'x' && isxdigit (*(s+2)) && isxdigit (*(s+3)))    {      *d++ = hexval (*(s+2)) << 4 | hexval (*(s+3));      s += 4;    }    else      *d++ = *s++;  }  *d = '\0';    mutt_decode_utf8_string (uid, _chs);}