14 int mutt_wctoutf8 (char *s, unsigned int c, size_t buflen)
22 else if (c < (1 << 11))
26 *s++ = 0xc0 | (c >> 6);
27 *s++ = 0x80 | (c & 0x3f);
31 else if (c < (1 << 16))
35 *s++ = 0xe0 | (c >> 12);
36 *s++ = 0x80 | ((c >> 6) & 0x3f);
37 *s++ = 0x80 | (c & 0x3f);
41 else if (c < (1 << 21))
45 *s++ = 0xf0 | (c >> 18);
46 *s++ = 0x80 | ((c >> 12) & 0x3f);
47 *s++ = 0x80 | ((c >> 6) & 0x3f);
48 *s++ = 0x80 | (c & 0x3f);
52 else if (c < (1 << 26))
56 *s++ = 0xf8 | (c >> 24);
57 *s++ = 0x80 | ((c >> 18) & 0x3f);
58 *s++ = 0x80 | ((c >> 12) & 0x3f);
59 *s++ = 0x80 | ((c >> 6) & 0x3f);
60 *s++ = 0x80 | (c & 0x3f);
64 else if (c < (1 << 31))
68 *s++ = 0xfc | (c >> 30);
69 *s++ = 0x80 | ((c >> 24) & 0x3f);
70 *s++ = 0x80 | ((c >> 18) & 0x3f);
71 *s++ = 0x80 | ((c >> 12) & 0x3f);
72 *s++ = 0x80 | ((c >> 6) & 0x3f);
73 *s++ = 0x80 | (c & 0x3f);
81 #endif /* !HAVE_WC_FUNCS */