15 #include "multibyte.h"
18 * PUBLIC: void * v_strset __P((CHAR_T *s, CHAR_T c, size_t n));
21 v_strset(CHAR_T
*s
, CHAR_T c
, size_t n
)
30 ucs2utf8(const CHAR_T
*src
, size_t len
, char *dst
)
34 for (i
= 0, j
= 0; i
< len
; ++i
) {
37 else if (src
[i
] < 0x800) {
38 dst
[j
++] = (src
[i
] >> 6) | 0xc0;
39 dst
[j
++] = (src
[i
] & 0x3f) | 0x80;
41 dst
[j
++] = (src
[i
] >> 12) | 0xe0;
42 dst
[j
++] = ((src
[i
] >> 6) & 0x3f) | 0x80;
43 dst
[j
++] = (src
[i
] & 0x3f) | 0x80;