feat: add Windows-1250 (Central European) encoding support#4
Open
albert-polak wants to merge 1 commit into
Open
feat: add Windows-1250 (Central European) encoding support#4albert-polak wants to merge 1 commit into
albert-polak wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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

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