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:6017–6031  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6015
6016#ifdef _WIN32
6017static wchar_t *cli_windows_utf8_to_wide(const char *value) {
6018 if (!value || !value[0]) {
6019 return NULL;
6020 }
6021 int needed = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, NULL, 0);
6022 if (needed <= 0) {
6023 return NULL;
6024 }
6025 wchar_t *wide = malloc((size_t)needed * sizeof(*wide));
6026 if (!wide || MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, wide, needed) <= 0) {
6027 free(wide);
6028 return NULL;
6029 }
6030 return wide;
6031}
6032
6033static bool cli_windows_path_segment_equal(const wchar_t *segment, size_t segment_length,
6034 const wchar_t *directory) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected