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

Source from the content-addressed store, hash-verified

5872
5873#ifdef _WIN32
5874static wchar_t *cli_windows_utf8_to_wide(const char *value) {
5875 if (!value || !value[0]) {
5876 return NULL;
5877 }
5878 int needed = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, NULL, 0);
5879 if (needed <= 0) {
5880 return NULL;
5881 }
5882 wchar_t *wide = malloc((size_t)needed * sizeof(*wide));
5883 if (!wide || MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, wide, needed) <= 0) {
5884 free(wide);
5885 return NULL;
5886 }
5887 return wide;
5888}
5889
5890static bool cli_windows_path_segment_equal(const wchar_t *segment, size_t segment_length,
5891 const wchar_t *directory) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected