diff --git a/esphome/analyze_memory/__init__.py b/esphome/analyze_memory/__init__.py index 9af03b76b8..fe08a5f966 100644 --- a/esphome/analyze_memory/__init__.py +++ b/esphome/analyze_memory/__init__.py @@ -623,7 +623,7 @@ class MemoryAnalyzer: current_symbol: str | None = None section_prefixes = (".text.", ".rodata.", ".data.", ".bss.", ".literal.") - for line in map_path.read_text().splitlines(): + for line in map_path.read_text(encoding="utf-8").splitlines(): # Match section.symbol line: " .text.symbol_name" # Single space indent, starts with dot if len(line) > 2 and line[0] == " " and line[1] == ".":