Function zifu::filename_decoder::decide_decoeder [−][src]
pub fn decide_decoeder(
decoders: &Vec<&Box<dyn IDecoder>>,
strings: &Vec<&Vec<u8>>
) -> Option<usize>
Guesses encoding from an array of sequences.
Returns an index of the array decoders
corresponding to the encoding that was able to decode all the strings
without error.
If no decoders
can decode all of strings
without error, returns None
.
Arguments
decoders
- encoding candidates. The smaller the index, the higher the prioritystrings
- strings that an encoding must be able to decode all of them