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

Source from the content-addressed store, hash-verified

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

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected