mirror of
https://github.com/github/awesome-copilot.git
synced 2026-06-13 11:33:32 +00:00
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:
@@ -233,6 +233,9 @@ def add_arrow_to_diagram(
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main entry point."""
|
"""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:
|
if len(sys.argv) < 6:
|
||||||
print("Usage: python add-arrow.py <diagram_path> <from_x> <from_y> <to_x> <to_y> [OPTIONS]")
|
print("Usage: python add-arrow.py <diagram_path> <from_x> <from_y> <to_x> <to_y> [OPTIONS]")
|
||||||
print("\nOptions:")
|
print("\nOptions:")
|
||||||
|
|||||||
@@ -329,6 +329,9 @@ def add_icon_to_diagram(
|
|||||||
|
|
||||||
def main():
|
def main():
|
||||||
"""Main entry point."""
|
"""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:
|
if len(sys.argv) < 5:
|
||||||
print("Usage: python add-icon-to-diagram.py <diagram_path> <icon_name> <x> <y> [OPTIONS]")
|
print("Usage: python add-icon-to-diagram.py <diagram_path> <icon_name> <x> <y> [OPTIONS]")
|
||||||
print("\nOptions:")
|
print("\nOptions:")
|
||||||
|
|||||||
Reference in New Issue
Block a user