MCPcopy Create free account
hub / github.com/LAStools/LAStools / UTF8toUTF16

Function UTF8toUTF16

LASzip/src/mydefs.cpp:51–58  ·  view source on GitHub ↗

Converting UTF-8 to UTF-16

Source from the content-addressed store, hash-verified

49#if defined(_WIN32)
50/// Converting UTF-8 to UTF-16
51wchar_t* UTF8toUTF16(const char* utf8) {
52 if (utf8 == nullptr) return nullptr;
53 int len = MultiByteToWideChar(CP_UTF8, 0, utf8, -1, nullptr, 0);
54 if (len <= 0) return nullptr;
55 wchar_t* utf16 = new wchar_t[len];
56 MultiByteToWideChar(CP_UTF8, 0, utf8, -1, utf16, len);
57 return utf16;
58}
59
60/// Converting ANSI to UTF-16
61wchar_t* ANSItoUTF16(const char* ansi) {

Callers 1

LASfopenFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected