Skip to content

fix: handle Windows charmap encoding errors for Unicode data#2

Open
theKorzh wants to merge 1 commit intoh3lix1:mainfrom
theKorzh:fix/windows-charmap-encoding
Open

fix: handle Windows charmap encoding errors for Unicode data#2
theKorzh wants to merge 1 commit intoh3lix1:mainfrom
theKorzh:fix/windows-charmap-encoding

Conversation

@theKorzh
Copy link
Copy Markdown

@theKorzh theKorzh commented Apr 3, 2026

Fixes #1

Problem

On Windows, the default 'charmap' codec may fail to encode certain Unicode
characters (e.g. \u95f0), causing exceptions when writing HTML output.

This was observed not only with sample data but also in other cases involving
non-ASCII content.

Solution

Explicitly set UTF-8 encoding when creating temporary HTML files.

Result

  • Prevents crashes on Windows
  • Ensures correct handling of Unicode characters
  • Makes behavior consistent across platforms

Tested on Windows 10 / Python 3.12

Fixes h3lix1#1

On Windows, the default 'charmap' codec may fail to encode certain Unicode
characters (e.g. \u95f0), causing exceptions when processing text data.
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.

Unable to retrieve sample data on windows

1 participant