13 int mutt_wctoutf8 (char *s, unsigned int c)
21 else if (c < (1 << 11))
25 *s++ = 0xc0 | (c >> 6);
26 *s++ = 0x80 | (c & 0x3f);
30 else if (c < (1 << 16))
34 *s++ = 0xe0 | (c >> 12);
35 *s++ = 0x80 | ((c >> 6) & 0x3f);
36 *s++ = 0x80 | (c & 0x3f);
40 else if (c < (1 << 21))
44 *s++ = 0xf0 | (c >> 18);
45 *s++ = 0x80 | ((c >> 12) & 0x3f);
46 *s++ = 0x80 | ((c >> 6) & 0x3f);
47 *s++ = 0x80 | (c & 0x3f);
51 else if (c < (1 << 26))
55 *s++ = 0xf8 | (c >> 24);
56 *s++ = 0x80 | ((c >> 18) & 0x3f);
57 *s++ = 0x80 | ((c >> 12) & 0x3f);
58 *s++ = 0x80 | ((c >> 6) & 0x3f);
59 *s++ = 0x80 | (c & 0x3f);
63 else if (c < (1 << 31))
67 *s++ = 0xfc | (c >> 30);
68 *s++ = 0x80 | ((c >> 24) & 0x3f);
69 *s++ = 0x80 | ((c >> 18) & 0x3f);
70 *s++ = 0x80 | ((c >> 12) & 0x3f);
71 *s++ = 0x80 | ((c >> 6) & 0x3f);
72 *s++ = 0x80 | (c & 0x3f);
80 #endif /* !HAVE_WC_FUNCS */