MCPcopy Create free account
hub / github.com/Predelnik/DSpellCheck / utf8_to_wstring

Function utf8_to_wstring

src/common/Utility.cpp:68–73  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68std::wstring utf8_to_wstring(const char *source) {
69 auto bytes = convert("UTF-8", "UCS-2LE//IGNORE", source, strlen(source), (utf8_length(source) + 1) * sizeof(wchar_t));
70 if (bytes.empty())
71 return {};
72 return reinterpret_cast<const wchar_t *>(bytes.data());
73}
74
75std::string utf8_to_string(const char *source) {
76 auto bytes = convert("UTF-8", "CHAR//IGNORE", source, strlen(source), utf8_length(source) + 1);

Callers 3

update_file_listMethod · 0.85
get_suggestionsMethod · 0.85
process_utf8Method · 0.85

Calls 4

utf8_lengthFunction · 0.85
dataMethod · 0.80
convertFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected