MCPcopy Create free account
hub / github.com/bailey27/cppcryptfs / unicode_to_utf8

Function unicode_to_utf8

libcppcryptfs/util/util.cpp:95–112  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

93}
94
95const char *
96unicode_to_utf8(const WCHAR *unicode_str, char *buf, int buflen)
97{
98 int len = WideCharToMultiByte(CP_UTF8, 0, unicode_str, -1, NULL, 0, NULL, NULL);
99
100 if (len == 0)
101 return NULL;
102
103 // len includes space for null char
104 if (len > buflen)
105 return NULL;
106
107 if (WideCharToMultiByte(CP_UTF8, 0, unicode_str, -1, buf, len, NULL, NULL) == 0) {
108 return NULL;
109 }
110
111 return buf;
112}
113
114const char *
115unicode_to_utf8(const WCHAR *unicode_str, string& storage)

Callers 10

OnInitDialogMethod · 0.85
encrypt_string_gcmFunction · 0.85
GetPathHashFunction · 0.85
init_serialMethod · 0.85
decrypt_keyMethod · 0.85
encrypt_keyMethod · 0.85
createMethod · 0.85
derive_path_ivFunction · 0.85
encrypt_filenameFunction · 0.85
decrypt_reverse_longnameFunction · 0.85

Calls 1

getMethod · 0.45

Tested by

no test coverage detected