Function aspasia::detect_format_with_encoding
source · pub fn detect_format_with_encoding(
path: impl AsRef<Path>,
encoding: Option<&'static Encoding>
) -> Result<Format, Error>
Expand description
Attempt to detect subtitle format from its extension first, then by file contents using the given encoding if that fails
Errors
- Returns
Error::FileIoError
if an error results while attempting to open the file for content detection. - Returns
Error::FormatUnknownError
if unable to conclusively determine a single format.