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

Source from the content-addressed store, hash-verified

5851
5852#ifdef _WIN32
5853static wchar_t *cli_windows_utf8_to_wide(const char *value) {
5854 if (!value || !value[0]) {
5855 return NULL;
5856 }
5857 int needed = MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, NULL, 0);
5858 if (needed <= 0) {
5859 return NULL;
5860 }
5861 wchar_t *wide = malloc((size_t)needed * sizeof(*wide));
5862 if (!wide || MultiByteToWideChar(CP_UTF8, MB_ERR_INVALID_CHARS, value, -1, wide, needed) <= 0) {
5863 free(wide);
5864 return NULL;
5865 }
5866 return wide;
5867}
5868
5869static bool cli_windows_path_segment_equal(const wchar_t *segment, size_t segment_length,
5870 const wchar_t *directory) {

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected