Skip to content

feat: add Windows-1250 (Central European) encoding support#4

Open
albert-polak wants to merge 1 commit into
ymonster:chardet7-previewfrom
albert-polak:chardet7-preview
Open

feat: add Windows-1250 (Central European) encoding support#4
albert-polak wants to merge 1 commit into
ymonster:chardet7-previewfrom
albert-polak:chardet7-preview

Conversation

@albert-polak
Copy link
Copy Markdown

Problem

Windows-1250 (Central European) was missing from RESTORE_ENCODINGS. Using Claude Code with files in Windows-1250 corrupted special characters (in my case Polish)
For pull request guide I looked at #3
The problem is that chardet<7 wasn't reliable at detecting cp1250/windows1250 so i looked at the chardet7-preview branch

Changes

hooks/encoding_guard.py: add "cp1250" to RESTORE_ENCODINGS
hooks/encoding_guard.py: change return from "detect_safely" to include "top_conf"

Testing

Verified manually with a CP1250-encoded source file
image

Pre hook converts CP1250 → UTF-8,
Post hook restores UTF-8 → CP1250 after edit
Stop hook restores files that were read but not edited

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.

1 participant