Skip to content

Commit a31d827

Browse files
committed
fix: force UTF-8 stdout on Windows to handle Unicode
1 parent 614bbb2 commit a31d827

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

src/treemapper/treemapper.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33

44

55
def main() -> None:
6+
# Force UTF-8 for stdout on Windows (default cp1252 can't handle Unicode)
7+
if sys.platform == "win32" and hasattr(sys.stdout, "reconfigure"):
8+
sys.stdout.reconfigure(encoding="utf-8")
69
from .cli import parse_args
710
from .clipboard import ClipboardError, copy_to_clipboard
811
from .ignore import get_ignore_specs

0 commit comments

Comments
 (0)