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

Function to_utf8_string

src/common/Utility.cpp:54–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54std::string to_utf8_string(std::string_view source) {
55 auto bytes = convert("CHAR", "UTF-8//IGNORE", source.data(), source.length(), max_utf8_char_length * (source.length() + 1));
56 if (bytes.empty())
57 return {};
58 return bytes.data();
59}
60
61std::string to_utf8_string(std::wstring_view source) {
62 auto bytes = convert("UCS-2LE", "UTF-8//IGNORE", source.data(), source.length() * sizeof(wchar_t), max_utf8_char_length * (source.length() + 1));

Callers 10

set_dataMethod · 0.85
to_editor_encodingMethod · 0.85
add_to_dictionaryMethod · 0.85
get_suggestionsMethod · 0.85
add_to_dictionaryMethod · 0.85
ignore_allMethod · 0.85
check_wordMethod · 0.85
process_replaceMethod · 0.85
get_win32_error_msgFunction · 0.85
process_utf8Method · 0.85

Calls 3

dataMethod · 0.80
convertFunction · 0.70
emptyMethod · 0.45

Tested by

no test coverage detected