napi_create_string_latin1

Function napi_create_string_latin1 

Source
pub unsafe extern "C" fn napi_create_string_latin1(
    env: napi_env,
    str_: *const c_char,
    length: usize,
    result: *mut napi_value,
) -> napi_status
Available on crate feature napi only.
Expand description

Creates an ArkTS string from an ISO-8859-1-encoded C string.

§Arguments

  • env - Current running virtual machine context.

  • str - C string encoded in ISO-8859-1-encoded format.

  • length - The length of the C string ‘str’.

  • result - Result of the ArkTS string from the ISO-8859-1-encoded C string.

§Returns

  • Returns the function execution status. [napi_ok] If the function executed successfully.

[napi_invalid_arg] If the param env, str and(or) result is nullptr.

Available since API-level: 10