diff --git a/detection/utils.py b/detection/utils.py index 563e7f0..c15e8ec 100644 --- a/detection/utils.py +++ b/detection/utils.py @@ -4,7 +4,7 @@ import sys def read_file_content(file_path: str) -> str: try: - with open(file_path, "r", encoding="utf-8") as file: + with open(file_path, "r", encoding="utf-8", errors="ignore") as file: return file.read() except FileNotFoundError: print("Error: File not found.") @@ -21,4 +21,4 @@ def remove_comments(code: str, extension: str) -> str: code = re.sub(r"//.*", "", code) code = re.sub(r"/\*.*?\*/", "", code, flags=re.DOTALL) return code.strip() - return code.strip() \ No newline at end of file + return code.strip()