Writing files in Windows crashes on certain unicode characters in cp1252 files. Specify utf-8 encoding when opening files.
The SaveLangchain function in PrintUtils.py writes MarkdownVersion to a file. The default encoding for file writing on Windows is cp1252, which doesn't support many Unicode characters and will sometimes cause a crash.
All lines that open files need to be specified as utf-8 like this:
with open(ThisLogPathJSON, "w", encoding="utf-8") as f:
with open(ThisLogPathMD, "w", encoding="utf-8") as f:
with open(f"{self.LogDirPrefix}/Story.md", "w", encoding="utf-8") as f:
https://github.com/datacrystals/AIStoryWriter/blob/25d675377e82f0bd0308ed630ebf25b2b7b41e16/Writer/PrintUtils.py#L41-L58
Same here Also need to change Write.py:248
with open(Args.Prompt, "r", encoding="utf-8") as f:
addressed by #76