Skip to content

Write rendered files as UTF-8 to fix Windows UnicodeEncodeError#228

Merged
pedjaradenkovic merged 1 commit into
mainfrom
worktree-fix-encode-issue
Jun 24, 2026
Merged

Write rendered files as UTF-8 to fix Windows UnicodeEncodeError#228
pedjaradenkovic merged 1 commit into
mainfrom
worktree-fix-encode-issue

Conversation

@pedjaradenkovic

Copy link
Copy Markdown
Contributor

store_response_files opened files with the platform default text codec, which on Windows is cp1252 and cannot encode characters like 📍 (U+1F4CD). LLM-generated content containing such characters crashed the render with UnicodeEncodeError. Specify encoding="utf-8" explicitly, matching how the rest of file_utils reads text. Add a regression test covering unicode content.

Fixes CODEPLAIN-P

https://codeplain.sentry.io/issues/7563551370/?project=4511540621213696&query=is%3Aunresolved&referrer=issue-stream

store_response_files opened files with the platform default text codec,
which on Windows is cp1252 and cannot encode characters like 📍 (U+1F4CD).
LLM-generated content containing such characters crashed the render with
UnicodeEncodeError. Specify encoding="utf-8" explicitly, matching how the
rest of file_utils reads text. Add a regression test covering unicode
content.

Fixes CODEPLAIN-P
@pedjaradenkovic pedjaradenkovic requested a review from zanjonke June 23, 2026 13:12

@zanjonke zanjonke left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@pedjaradenkovic pedjaradenkovic merged commit 3e43240 into main Jun 24, 2026
10 checks passed
@pedjaradenkovic pedjaradenkovic deleted the worktree-fix-encode-issue branch June 24, 2026 07:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants