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

Function wide_to_utf8

src/daemon/ipc.c:3569–3584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3567}
3568
3569static char *wide_to_utf8(const wchar_t *value) {
3570 if (!value) {
3571 return NULL;
3572 }
3573 int needed = WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, value, -1, NULL, 0, NULL, NULL);
3574 if (needed <= 0) {
3575 return NULL;
3576 }
3577 char *utf8 = malloc((size_t)needed);
3578 if (!utf8 || WideCharToMultiByte(CP_UTF8, WC_ERR_INVALID_CHARS, value, -1, utf8, needed, NULL,
3579 NULL) <= 0) {
3580 free(utf8);
3581 return NULL;
3582 }
3583 return utf8;
3584}
3585
3586static wchar_t *wide_copy(const wchar_t *value) {
3587 if (!value) {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected