pub fn is_text<R: Read>(reader: R) -> Result<bool>Expand description
Determine if data from a reader contains text or binary content.
This function reads up to 1KB from the provided reader and analyzes the bytes to determine if they represent text or binary data.
§Arguments
reader- A reader providing the data to analyze
§Returns
true if the data appears to be text, false if binary.
§Examples
use file_identify::is_text;
use std::io::Cursor;
let text_data = Cursor::new(b"Hello, world!");
assert!(is_text(text_data).unwrap());
let binary_data = Cursor::new(&[0x7f, 0x45, 0x4c, 0x46, 0x00]);
assert!(!is_text(binary_data).unwrap());