pub unsafe extern "C" fn NewStringFromUTF8Buffer(
cx: *mut JSContext,
buffer: RefPtr<StringBuffer>,
length: usize,
) -> *mut JSString
Expand description
Similar to NewStringFromLatin1Buffer but for UTF8 buffers.
This can create a Latin1 string backed by |buffer| iff the utf8 buffer contains only ASCII chars. If there are non-ASCII chars, |buffer| can’t be used so this API will copy and inflate the characters for the new JS string.
Note that |length| must be the (byte) length of the UTF8 buffer.