Skip to content

fix: replace emoji with ASCII text to prevent Windows cp1252 crash#266

Open
ReynardL wants to merge 1 commit into
interviewstreet:mainfrom
ReynardL:fix/windows-emoji-encoding
Open

fix: replace emoji with ASCII text to prevent Windows cp1252 crash#266
ReynardL wants to merge 1 commit into
interviewstreet:mainfrom
ReynardL:fix/windows-emoji-encoding

Conversation

@ReynardL

Copy link
Copy Markdown

Summary

  • Replace emoji characters in print() and logger calls with ASCII-safe text across 5 files
  • Decorative emoji in report output (📊, 🎯, 🚀, etc.) removed entirely
  • Warning/error indicators replaced with [WARNING] / [ERROR] tags
  • No behavioral changes, only string formatting

Problem

On Windows, Python defaults to cp1252 encoding for stdout. Any print() or log statement containing emoji crashes with UnicodeEncodeError when triggered:

UnicodeEncodeError: 'charmap' codec can't encode characters in position 0-1

This affects all error/warning paths in the codebase. Users see a cryptic encoding crash instead of the actual diagnostic message.

Files changed

File Instances fixed
prompts/template_manager.py 4
score.py 13
pdf.py 16
github.py 16
llm_utils.py 3

Testing

Verified on Windows 11 with Python 3.13 (cp1252 stdout) that all replaced messages print without errors. Black formatting applied.

Closes #265

Python's default stdout encoding on Windows is cp1252, which cannot encode emoji characters. Error handlers crash with UnicodeEncodeError instead of displaying the actual warning/error message.

Closes interviewstreet#265
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Bug: Unicode emoji in print/log statements crash on Windows (cp1252)

1 participant