pub unsafe extern "C" fn JSStringGetUTF8CString(
string: JSStringRef,
buffer: *mut c_char,
bufferSize: usize,
) -> usize
Expand description
Converts a JavaScript string into a null-terminated UTF8 string, and copies the result into an external byte buffer.
string
: The sourceJSStringRef
.buffer
: The destination byte buffer into which to copy a null-terminated UTF8 representation ofstring
. On return,buffer
contains a UTF8 string representation ofstring
. IfbufferSize
is too small,buffer
will contain only partial results. Ifbuffer
is not at leastbufferSize
bytes in size, behavior is undefined.bufferSize
: The size of the external buffer in bytes.
Returns the number of bytes written into buffer (including the null-terminator byte).