MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / utf8_to_wide

Function utf8_to_wide

src/daemon/ipc.c:3574–3588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3572}
3573
3574static wchar_t *utf8_to_wide(const char *value) {
3575 if (!value) {
3576 return NULL;
3577 }
3578 int needed = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, NULL, 0);
3579 if (needed <= 0) {
3580 return NULL;
3581 }
3582 wchar_t *wide = malloc((size_t)needed * sizeof(*wide));
3583 if (!wide || MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, wide, needed) <= 0) {
3584 free(wide);
3585 return NULL;
3586 }
3587 return wide;
3588}
3589
3590static char *wide_to_utf8(const wchar_t *value) {
3591 if (!value) {

Calls

no outgoing calls

Tested by

no test coverage detected