Skip to main content

nova_rt_str_from_chars

Function nova_rt_str_from_chars 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn nova_rt_str_from_chars( cs: *const u8, ) -> *mut NovaStr
Expand description

Encode a Nova [Char] back into a string.

A word that is not a valid Unicode scalar value becomes char::REPLACEMENT_CHARACTER rather than aborting, matching what nova_rt_char_to_str already does. Nova source cannot produce one — there is no Int → Char conversion in the language (let c: Char = 65 is E0010, 'a' + 1 is E0010, and no such builtin exists) — so this is defensive only.

§Safety

cs must point to a Nova array of Char: { len: i64, elems… } with element i at byte offset 8 + 8*i.