std.txt.ascii_printable

std.txt

ascii_printable(filename) -> is_ascii

Check if a file contains only ASCII printable characters

Reads up to the first 512 bytes of the file and checks each byte. Bytes in the range 0x20–0x7E are considered printable. CR (0x0D) and LF (0x0A) are accepted. Any other byte causes the function to return false. Returns false if the file cannot be opened.