bojand / infer

Small crate to infer file and MIME type by checking the magic number signature
MIT License
299 stars 28 forks source link

XML file not recognized #61

Closed qarmin closed 2 years ago

qarmin commented 2 years ago
    let path = "System.Runtime.xml";
    println!("{:?}", infer::get_from_path(Path::new(&path)))

prints

Ok(None)

System.Runtime.xml.zip

qarmin commented 2 years ago

Problem happens, because file starts with BOM - https://en.wikipedia.org/wiki/Byte_order_mark#Byte_order_marks_by_encoding