MCPcopy Create free account
hub / github.com/VCVRack/Rack / UTF8toUTF16

Function UTF8toUTF16

src/string.cpp:560–572  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

558
559
560std::wstring UTF8toUTF16(const std::string& s) {
561 if (s.empty())
562 return L"";
563 // Compute length of output buffer
564 int len = MultiByteToWideChar(CP_UTF8, 0, &s[0], s.size(), NULL, 0);
565 assert(len > 0);
566 std::wstring w;
567 // Allocate enough space for null character
568 w.resize(len);
569 len = MultiByteToWideChar(CP_UTF8, 0, &s[0], s.size(), &w[0], len);
570 assert(len > 0);
571 return w;
572}
573#endif
574
575

Callers 8

mainFunction · 0.85
fopen_u8Function · 0.85
loadLibraryFunction · 0.85
archiveDirectoryFunction · 0.85
unarchiveToDirectoryFunction · 0.85
openBrowserFunction · 0.85
openDirectoryFunction · 0.85
runProcessDetachedFunction · 0.85

Calls 2

emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected