in devai-api/app/file_processor.py [0:0]
def is_ascii_text(file_path):
"""
Check if the file contains ASCII text.
:param file_path: Path to the file
:return: Boolean indicating whether the file contains ASCII text
"""
try:
with open(file_path, 'r', encoding='utf-8') as f:
f.read()
return True
except UnicodeDecodeError:
return False