encoding::types

Function decode

Source
pub fn decode(
    input: &[u8],
    trap: DecoderTrap,
    fallback_encoding: EncodingRef,
) -> (Result<String, Cow<'static, str>>, EncodingRef)
Expand description

Determine the encoding by looking for a Byte Order Mark (BOM) and decoded a single string in memory. Return the result and the used encoding.