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

Function utf8_to_wide

src/daemon/ipc.c:3512–3526  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3510}
3511
3512static wchar_t *utf8_to_wide(const char *value) {
3513 if (!value) {
3514 return NULL;
3515 }
3516 int needed = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, NULL, 0);
3517 if (needed <= 0) {
3518 return NULL;
3519 }
3520 wchar_t *wide = malloc((size_t)needed * sizeof(*wide));
3521 if (!wide || MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, wide, needed) <= 0) {
3522 free(wide);
3523 return NULL;
3524 }
3525 return wide;
3526}
3527
3528static char *wide_to_utf8(const wchar_t *value) {
3529 if (!value) {

Calls

no outgoing calls

Tested by

no test coverage detected