Function encoding_c::encoding_for_label_no_replacement
[−]
[src]
#[no_mangle]pub unsafe extern fn encoding_for_label_no_replacement(label: *const u8,
label_len: usize)
-> *const Encoding
This function behaves the same as encoding_for_label()
, except when
encoding_for_label()
would return REPLACEMENT_ENCODING
, this method
returns NULL
instead.
This method is useful in scenarios where a fatal error is required upon invalid label, because in those cases the caller typically wishes to treat the labels that map to the replacement encoding as fatal errors, too.
Undefined behavior
UB ensues if label
and label_len
don't designate a valid memory block.