MCPcopy Create free account
hub / github.com/WallBreaker2/op / encodeUnicodeBytes

Function encodeUnicodeBytes

libop/memory/ProcessMemory.cpp:53–58  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

51}
52
53vector<uchar> encodeUnicodeBytes(const wstring &text) {
54 vector<uchar> bin((text.size() + 1) * sizeof(wchar_t));
55 if (!text.empty())
56 memcpy(bin.data(), text.c_str(), text.size() * sizeof(wchar_t));
57 return bin;
58}
59
60size_t trimNullByteLength(const vector<uchar> &bin, size_t charWidth) {
61 if (charWidth == 0 || bin.empty())

Callers 1

WriteStringMethod · 0.85

Calls 3

sizeMethod · 0.45
emptyMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected