Very performant file encoding detector