(s: str, encoding: str = "utf-8")
| 4 | from helpers import files |
| 5 | |
| 6 | def sanitize_string(s: str, encoding: str = "utf-8") -> str: |
| 7 | # Replace surrogates and invalid unicode with replacement character |
| 8 | if not isinstance(s, str): |
| 9 | s = str(s) |
| 10 | return s.encode(encoding, 'replace').decode(encoding, 'replace') |
| 11 | |
| 12 | def calculate_valid_match_lengths(first: bytes | str, second: bytes | str, |
| 13 | deviation_threshold: int = 5, |
no test coverage detected