| 51 | } |
| 52 | |
| 53 | vector<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 | |
| 60 | size_t trimNullByteLength(const vector<uchar> &bin, size_t charWidth) { |
| 61 | if (charWidth == 0 || bin.empty()) |
no test coverage detected