encoding_new_encoder

Function encoding_new_encoder 

Source
#[unsafe(no_mangle)]
pub unsafe extern "C" fn encoding_new_encoder( encoding: *const Encoding, ) -> *mut Encoder
Expand description

Allocates a new Encoder for the given Encoding on the heap and returns a pointer to the newly-allocated Encoder. (Exception, if the Encoding is replacement, a new Decoder for UTF-8 is instantiated (and that Decoder reports UTF_8 as its Encoding).

Once the allocated Encoder is no longer needed, the caller MUST deallocate it by passing the pointer returned by this function to encoder_free().

ยงUndefined behavior

UB ensues if the argument is NULL.