ComfyUI-Custom-Scripts icon indicating copy to clipboard operation
ComfyUI-Custom-Scripts copied to clipboard

Save text error encoding fix: encoding="utf-8"

Open obsidianocean opened this issue 9 months ago • 1 comments

When working with non-ASCII text on Windows the save text node will fail. Python on Windows defaults to cp1252 when you open files. Adding encoding="utf-8" fixes this.

please add something like this to your text_files.py

with open(self.file, "a+" if kwargs["append"] == "append" else "w", encoding="utf-8"

obsidianocean avatar Feb 12 '26 02:02 obsidianocean

if anyone running into this issue you can replace text_files.py inside py folder

text_files.py

obsidianocean avatar Feb 12 '26 03:02 obsidianocean