Skip to content

fix: specify utf-8 encoding in read_text calls on Windows#31

Open
sachinML wants to merge 1 commit intohuggingface:mainfrom
sachinML:fix/windows-read-text-encoding
Open

fix: specify utf-8 encoding in read_text calls on Windows#31
sachinML wants to merge 1 commit intohuggingface:mainfrom
sachinML:fix/windows-read-text-encoding

Conversation

@sachinML
Copy link
Copy Markdown

Summary

Fixes Windows encoding issues caused by calling read_text() without specifying encoding="utf-8".

On Windows, Path.read_text() can default to cp1252, which may break when reading UTF-8 files. This PR updates the relevant call(s) to use UTF-8 explicitly.

Fixes #18

@sachinML
Copy link
Copy Markdown
Author

sachinML commented Apr 5, 2026

Hi, just following up on this PR.
This is a small Windows compatibility fix to make read_text() use encoding="utf-8" explicitly.
Happy to make any changes if needed. Thanks!

@sachinML
Copy link
Copy Markdown
Author

Hi @burtenshaw, do you see any possible improvements in this PR.

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.

BUG: read_text() without UTF-8 encoding causes issues on Windows (uses cp1252 by default)

1 participant