UnicodeEncodeError on Windows (cp1252) — emoji output crashes `superclaude install` / `--list`
Summary
On Windows, running any superclaude subcommand that emits emoji to stdout crashes with UnicodeEncodeError because the default console encoding is cp1252. This affects every documented happy-path command (install, install --list, install --force, mcp --list, etc.) — the very first click.echo(" ...") call raises.
Workaround that unblocks users today: prefix the call with PYTHONIOENCODING=utf-8 PYTHONUTF8=1. But fresh Windows installs hit this before they ever read the README.
Environment
- OS: Windows 11 Home (10.0.26200),
cp1252default console - Python: 3.13.5 (pipx-managed venv)
- SuperClaude: 4.3.0 (also reproduces on 4.2.0)
- Shell: Git Bash and PowerShell both affected (PowerShell needs
chcp 65001first or it crashes too)
Reproduction
pipx install SuperClaude
superclaude install --listActual
Traceback (most recent call last):
...
File ".../superclaude/cli/main.py", line 69, in install
click.echo("\U0001f4cb Available Commands:")
...
File ".../Lib/encodings/cp1252.py", line 19, in encode
return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\U0001f4cb' in position 0: character maps to <undefined>Same trace from superclaude install --force (crashes on `` on line 85).
Expected
Command runs to completion. Emoji either render (on UTF-8 terminals) or degrade gracefully (on legacy code-page terminals).
Root cause
superclaude/cli/main.py calls click.echo() with literal emoji ( ✅ ⬜ …) on rows 69, 75, 79, 85, 93, 133 and beyond. On Windows, Python opens sys.stdout with the console's active code page (cp1252 on Finnish/most Western locales). click.echo writes through that stream and inherits the encoding error.
Suggested fix
Add a single guard at the top of main() in superclaude/cli/main.py:
import sys
@click.group()
@click.version_option(version=__version__, prog_name="SuperClaude")
def main():
# Ensure emoji output survives legacy Windows code pages (cp1252 etc.)
if sys.platform == "win32":
try:
sys.stdout.reconfigure(encoding="utf-8", errors="replace")
sys.stderr.reconfigure(encoding="utf-8", errors="replace")
except (AttributeError, OSError):
pass # older Python or non-reconfigurable stream
...errors="replace" keeps very old consoles working (emoji become ? instead of crashing the install). Python 3.7+ has reconfigure(). No external dependency added.
Alternative if you'd rather not touch streams globally: route every emoji through a helper like safe_echo() that strips non-ASCII when sys.stdout.encoding can't encode it.
Notes
Happy to send a PR with the reconfigure approach if it's the direction you'd take. Filed today after running pipx upgrade SuperClaude 4.2.0 → 4.3.0 on a Windows box and seeing every CLI path crash until PYTHONIOENCODING=utf-8 was set.
Source: SuperClaude-Org/SuperClaude_Framework