Function mozjs::jsapi::JS_EncodeStringToLatin1

source ยท
pub unsafe extern "C" fn JS_EncodeStringToLatin1(
    cx: *mut JSContext,
    str_: *mut JSString,
) -> u64
Expand description

DEPRECATED

Allocate memory sufficient to contain the characters of |str| truncated to Latin-1 and a trailing null terminator, fill the memory with the characters interpreted in that manner plus the null terminator, and return a pointer to the memory.

This function loses information when it copies the characters of |str| if |str| contains code units greater than 0xFF. Additionally, users that depend on null-termination will misinterpret the copied characters if |str| contains any nulls. Avoid using this function if possible, because it will eventually be removed.