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

Function cli_windows_utf8_to_wide

src/cli/cli.c:6684–6698  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6682
6683#ifdef _WIN32
6684static wchar_t *cli_windows_utf8_to_wide(const char *value) {
6685 if (!value || !value[0]) {
6686 return NULL;
6687 }
6688 int needed = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, NULL, 0);
6689 if (needed <= 0) {
6690 return NULL;
6691 }
6692 wchar_t *wide = malloc((size_t)needed * sizeof(*wide));
6693 if (!wide || MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, wide, needed) <= 0) {
6694 free(wide);
6695 return NULL;
6696 }
6697 return wide;
6698}
6699
6700static bool cli_windows_path_segment_equal(const wchar_t *segment, size_t segment_length,
6701 const wchar_t *directory) {

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected