encoding_c

Function encoding_name

source
#[no_mangle]
pub unsafe extern "C" fn encoding_name(
    encoding: *const Encoding,
    name_out: *mut u8,
) -> usize
Expand description

Writes the name of the given Encoding to a caller-supplied buffer as ASCII and returns the number of bytes / ASCII characters written.

The output is not null-terminated.

The caller MUST ensure that name_out points to a buffer whose length is at least ENCODING_NAME_MAX_LENGTH bytes.

§Undefined behavior

UB ensues if either argument is NULL or if name_out doesn’t point to a valid block of memory whose length is at least ENCODING_NAME_MAX_LENGTH bytes.