pub fn is_text_file(path: &Path) -> Result<bool>
Checks whether a file in path is a text file by loading the first 8000 bytes (or whole file) and checks if it contains 0 (NUL). The technique is used also by Git.
path