fix(excalidraw-diagram-generator): force UTF-8 stdout so add-arrow/add-icon don't crash on Windows (#1914)

* fix(excalidraw-diagram-generator): force UTF-8 stdout in add-arrow / add-icon so the success print doesn't crash on Windows cp1252

* fix(excalidraw-diagram-generator): force UTF-8 stdout in add-arrow / add-icon so the success print doesn't crash on Windows cp1252
This commit is contained in:
Emile du Toit
2026-06-11 01:58:22 -04:00
committed by GitHub
parent c4a0a3ef5a
commit b35e636e5b
2 changed files with 6 additions and 0 deletions
@@ -233,6 +233,9 @@ def add_arrow_to_diagram(
def main():
"""Main entry point."""
if hasattr(sys.stdout, "reconfigure"):
# Ensure consistent UTF-8 output on Windows consoles.
sys.stdout.reconfigure(encoding="utf-8")
if len(sys.argv) < 6:
print("Usage: python add-arrow.py <diagram_path> <from_x> <from_y> <to_x> <to_y> [OPTIONS]")
print("\nOptions:")
@@ -329,6 +329,9 @@ def add_icon_to_diagram(
def main():
"""Main entry point."""
if hasattr(sys.stdout, "reconfigure"):
# Ensure consistent UTF-8 output on Windows consoles.
sys.stdout.reconfigure(encoding="utf-8")
if len(sys.argv) < 5:
print("Usage: python add-icon-to-diagram.py <diagram_path> <icon_name> <x> <y> [OPTIONS]")
print("\nOptions:")