diff --git a/stellarisdashboard/parsing/save_parser.py b/stellarisdashboard/parsing/save_parser.py index dd83a43..c1e6445 100644 --- a/stellarisdashboard/parsing/save_parser.py +++ b/stellarisdashboard/parsing/save_parser.py @@ -383,8 +383,13 @@ def parse_save(self, filename): self.save_filename = filename logger.info(f"Parsing Save File {self.save_filename}...") with zipfile.ZipFile(self.save_filename) as save_zip: - # encoding guess based on EU4 wiki https://eu4.paradoxwikis.com/Save-game_editing#File_locations - gamestate = save_zip.read("gamestate").decode("cp1252") + gamestate = save_zip.read("gamestate") + try: + # default encoding guess based on EU4 wiki https://eu4.paradoxwikis.com/Save-game_editing#File_locations + gamestate = gamestate.decode("cp1252") + except UnicodeError: + # attempt UTF-8, ignoring any further errors + gamestate = gamestate.decode("utf-8", errors="ignore") self.parse_from_string(gamestate) return self.gamestate_dict