Skip to content

Fix UnicodeEncodeError on Windows CLI - #15

Merged
dippatel1994 merged 1 commit into
mainfrom
fix/windows-unicode-spinner-error
Feb 12, 2026
Merged

Fix UnicodeEncodeError on Windows CLI#15
dippatel1994 merged 1 commit into
mainfrom
fix/windows-unicode-spinner-error

Conversation

@dippatel1994

Copy link
Copy Markdown
Member

Summary

  • Fixes the UnicodeEncodeError: 'charmap' codec can't encode character '\u280b' error on Windows
  • Changed the Rich spinner from default (Braille characters) to line spinner (ASCII: - \ | /)
  • Braille characters like (\u280b) are not supported by Windows console's default code page (cp1252)

Root Cause

The default SpinnerColumn() in Rich uses Braille pattern characters for animation. Windows Command Prompt uses code page 1252 (or similar locale-specific encoding) which cannot encode these Unicode characters, causing Python to raise UnicodeEncodeError.

Solution

Use SpinnerColumn(spinner_name="line") which uses ASCII characters (- \ | /) that work on all terminal encodings.

Test Plan

  • Verify CLI works on Windows 11 with Python 3.13
  • Verify CLI still works on macOS/Linux

Fixes #14

The default Rich SpinnerColumn uses Braille characters (e.g., \u280b)
which cannot be encoded by Windows console's default code page (cp1252).

Changed to 'line' spinner which uses ASCII characters (- \ | /) that
are compatible with all terminal encodings.

Fixes #14
@dippatel1994 dippatel1994 self-assigned this Feb 12, 2026
@dippatel1994 dippatel1994 added the bug Something isn't working label Feb 12, 2026
@dippatel1994
dippatel1994 merged commit b6d1b4b into main Feb 12, 2026
3 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: UnicodeEncodeError: 'charmap' codec can't encode character '\u280b' in position 0: character maps to <undefined>

1 participant