Copies a JavaScript string into native memory and appends a trailing NUL terminator.
length must be large enough to hold the full encoded string plus the trailing NUL terminator. For UTF-16 and UCS-2 encodings, the trailing terminator uses two zero bytes.
pointer must refer to writable native memory with at least length bytes of available storage. This function does not allocate memory on its own.
string must be a JavaScript string. encoding must be a string.