Skip to content

fix: use UTF-8 encoding for file I/O on Windows#186

Open
mvanhorn wants to merge 1 commit into
Mebus:masterfrom
mvanhorn:fix/48-windows-utf8-encoding
Open

fix: use UTF-8 encoding for file I/O on Windows#186
mvanhorn wants to merge 1 commit into
Mebus:masterfrom
mvanhorn:fix/48-windows-utf8-encoding

Conversation

@mvanhorn

@mvanhorn mvanhorn commented Jul 2, 2026

Copy link
Copy Markdown

Summary

On Windows, reading and writing wordlist/config files used the platform default encoding (cp1252), so non-ASCII characters raised UnicodeDecodeError/UnicodeEncodeError or were corrupted.

Changes

Open the affected file reads/writes with explicit encoding="utf-8" so behavior matches Linux/macOS regardless of the Windows locale.

Testing

Added a test in test_cupp.py covering round-tripping non-ASCII content.

Fixes #48

@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 high

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
ErrorProne 1 high

View in Codacy

🟢 Metrics 0 complexity

Metric Results
Complexity 0

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

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.

Error when running test_cupp.py on windows

1 participant