Originally created by: fu351
Found while installing Doberman on a Windows laptop to dogfood it: doberman install-hooks / setup crash with UnicodeEncodeError on the default Windows cp1252 console — they print decorative Unicode (→, box-drawing rules, em-dashes) via typer.echo, and cp1252 can't encode them. This blocks onboarding for any such user.
Universal fix (two layers):
_ensure_encode_safe_stdio() at the CLI entry reconfigures stdout/stderr to UTF-8 with errors="replace" (no-op where reconfigure is unavailable) — so all CLI output, including dynamic content, can never crash on the console encoding.->, -, x) so output also renders cleanly on any console (not just UTF-8).tests/unit/test_cli_encode_safe.py: a strict-cp1252 stdout no longer raises after the safe-guard; install-hooks --dry-run and setup --yes output is ASCII and cp1252-encodable. Local: ruff/format clean; CLI/hook/setup suite (136) green.
pip install -e . didn't generate the doberman.exe console script on this Windows setup (a normal pip install doberman-core does). Worth a quick check of the editable packaging for dev onboarding.
Ticket changed by: Bestpart-Irene