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

Source from the content-addressed store, hash-verified

5789
5790#ifdef _WIN32
5791static wchar_t *cli_windows_utf8_to_wide(const char *value) {
5792 if (!value || !value[0]) {
5793 return NULL;
5794 }
5795 int needed = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, NULL, 0);
5796 if (needed <= 0) {
5797 return NULL;
5798 }
5799 wchar_t *wide = malloc((size_t)needed * sizeof(*wide));
5800 if (!wide || MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, wide, needed) <= 0) {
5801 free(wide);
5802 return NULL;
5803 }
5804 return wide;
5805}
5806
5807static bool cli_windows_path_segment_equal(const wchar_t *segment, size_t segment_length,
5808 const wchar_t *directory) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected