9 int mutt_wctoutf8 (char *s, unsigned int c)
17 else if (c < (1 << 11))
21 *s++ = 0xc0 | (c >> 6);
22 *s++ = 0x80 | (c & 0x3f);
26 else if (c < (1 << 16))
30 *s++ = 0xe0 | (c >> 12);
31 *s++ = 0x80 | ((c >> 6) & 0x3f);
32 *s++ = 0x80 | (c & 0x3f);
36 else if (c < (1 << 21))
40 *s++ = 0xf0 | (c >> 18);
41 *s++ = 0x80 | ((c >> 12) & 0x3f);
42 *s++ = 0x80 | ((c >> 6) & 0x3f);
43 *s++ = 0x80 | (c & 0x3f);
47 else if (c < (1 << 26))
51 *s++ = 0xf8 | (c >> 24);
52 *s++ = 0x80 | ((c >> 18) & 0x3f);
53 *s++ = 0x80 | ((c >> 12) & 0x3f);
54 *s++ = 0x80 | ((c >> 6) & 0x3f);
55 *s++ = 0x80 | (c & 0x3f);
59 else if (c < (1 << 31))
63 *s++ = 0xfc | (c >> 30);
64 *s++ = 0x80 | ((c >> 24) & 0x3f);
65 *s++ = 0x80 | ((c >> 18) & 0x3f);
66 *s++ = 0x80 | ((c >> 12) & 0x3f);
67 *s++ = 0x80 | ((c >> 6) & 0x3f);
68 *s++ = 0x80 | (c & 0x3f);
76 #endif /* !HAVE_WC_FUNCS */