#[no_mangle]
pub unsafe extern "C" fn encoding_new_decoder_with_bom_removal_into(
encoding: *const Encoding,
decoder: *mut Decoder,
)
Expand description
Allocates a new Decoder
for the given Encoding
into memory provided by
the caller with BOM removal.
If the input starts with bytes that are the BOM for this encoding, those bytes are removed. However, the decoder never morphs into a decoder for another encoding: A BOM for another encoding is treated as (potentially malformed) input to the decoding algorithm for 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 either argument is NULL
.