napi_get_value_string_latin1
functionv1js_native_api.hThis API returns the ISO-8859-1-encoded string corresponding the value passed in.
napi_status napi_get_value_string_latin1(napi_env env,
napi_value value,
char* buf,
size_t bufsize,
size_t* result)
[in] env: The environment that the API is invoked under.[in] value:napi_valuerepresenting JavaScript string.[in] buf: Buffer to write the ISO-8859-1-encoded string into. IfNULLis passed in, the length of the string in bytes and excluding the null terminator is returned inresult.[in] bufsize: Size of the destination buffer. When this value is insufficient, the returned string is truncated and null-terminated. If this value is zero, then the string is not returned and no changes are done to the buffer.[out] result: Number of bytes copied into the buffer, excluding the null terminator.
Returns napi_ok if the API succeeded. If a non-string napi_value
is passed in it returns napi_string_expected.
This API returns the ISO-8859-1-encoded string corresponding the value passed in.