MCPcopy Create free account
hub / github.com/CalcProgrammer1/OpenRGB / utf8_decode

Function utf8_decode

wmi/wmi.cpp:21–32  ·  view source on GitHub ↗

Convert an UTF8 string to a wide Unicode String

Source from the content-addressed store, hash-verified

19
20// Convert an UTF8 string to a wide Unicode String
21std::wstring utf8_decode(const std::string& str)
22{
23 if (str.empty())
24 {
25 return std::wstring();
26 }
27
28 int size_needed = MultiByteToWideChar(CP_UTF8, 0, &str[0], (int) str.size(), nullptr, 0);
29 std::wstring wstrTo(size_needed, 0);
30 MultiByteToWideChar(CP_UTF8, 0, &str[0], (int) str.size(), &wstrTo[0], size_needed);
31 return wstrTo;
32}
33
34bool isMatch(const std::string& value, const std::regex& re)
35{

Callers 2

queryMethod · 0.85
EnableAutoStartMethod · 0.85

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected