#[no_mangle]
pub unsafe extern "C" fn encoding_new_decoder(
encoding: *const Encoding,
) -> *mut Decoder
Expand description
Allocates a new Decoder
for the given Encoding
on the heap with BOM
sniffing enabled and returns a pointer to the newly-allocated Decoder
.
BOM sniffing may cause the returned decoder to morph into a decoder for UTF-8, UTF-16LE or UTF-16BE instead of this encoding.
Once the allocated Decoder
is no longer needed, the caller MUST
deallocate it by passing the pointer returned by this function to
decoder_free()
.
ยงUndefined behavior
UB ensues if the argument is NULL
.