17 #include "multibyte.h"
20 ucs2utf8(const CHAR_T
*src
, size_t len
, char *dst
)
24 for (i
= 0, j
= 0; i
< len
; ++i
) {
27 else if (src
[i
] < 0x800) {
28 dst
[j
++] = (src
[i
] >> 6) | 0xc0;
29 dst
[j
++] = (src
[i
] & 0x3f) | 0x80;
31 dst
[j
++] = (src
[i
] >> 12) | 0xe0;
32 dst
[j
++] = ((src
[i
] >> 6) & 0x3f) | 0x80;
33 dst
[j
++] = (src
[i
] & 0x3f) | 0x80;