-
Notifications
You must be signed in to change notification settings - Fork 2
String Handling
minisbett edited this page Mar 21, 2026
·
5 revisions
Strings are always encoded in UTF-8 when passed over the FFI-boundary in either direction. Internally, the conversion is done via the Utf8StringMarshaller.
When functions return strings to the caller, they will have a buffer and a bufferSize parameter. If the provided buffer is a nullptr, the required buffer size will be written at the specified bufferSize pointer, and the error code BufferSizeQuery is returned. Therefore, 2 function calls are required at most. If a buffer is specified and too small, the string is truncated at the provided bufferSize.