- std::string code(str.str());
-
- CYPool pool;
- CYUTF16String utf16(CYPoolUTF16String(pool, CYUTF8String(code.c_str(), code.size())));
-
- size_t bytes(utf16.size * sizeof(uint16_t));
- uint16_t *copy(reinterpret_cast<uint16_t *>(malloc(bytes)));
- memcpy(copy, utf16.data, bytes);
-
- *data = copy;
- *size = utf16.size;
- return true;