mirror of
https://github.com/tiennm99/serena.git
synced 2026-10-04 22:13:47 +00:00
FileUtils.read_file has two return paths with different newline semantics. The primary path, open(file_path, encoding=encoding).read(), uses the default newline=None and therefore applies universal newlines, so CR never reaches callers. The charset_normalizer fallback decodes the raw bytes instead (match.raw.decode(match.encoding)), which performs no newline translation, so any file that fails to decode with the project's configured encoding re-enters Serena carrying its CR characters. Normalize to LF at the fallback's return, matching the primary path.