fix: prevent UnicodeEncodeError on Windows in search output - #81
Closed
ThanhNguyxn07 wants to merge 4 commits into
Closed
fix: prevent UnicodeEncodeError on Windows in search output#81ThanhNguyxn07 wants to merge 4 commits into
ThanhNguyxn07 wants to merge 4 commits into
Conversation
… Windows encoding errors This addresses issue MemPalace#47 where the Unicode box-drawing character '─' (U+2500) in searcher.py caused UnicodeEncodeError crashes on Windows systems using the cp1252 encoding. The character has been replaced with a standard ASCII dash '-' to ensure compatibility across all platforms.
…it command argument parsing This commit addresses two issues: 1. For the Unicode encoding issue on Windows: - Added _ensure_utf8_encoding() function to handle UTF-8 encoding properly on Windows - Implemented proper encoding reconfiguration for stdout when running on Windows - Restored the original Unicode box-drawing character (─) which is now properly handled 2. For the split command issue (MemPalace#63): - Fixed cmd_split function to pass directory as --source argument instead of positional argument - This resolves the argument parsing error when running 'mempalace split <dir>' - The split command now correctly passes arguments to the underlying split_mega_files module
Contributor
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.
Summary
Why
Issue #47 reports that mempalace search crashes on Windows when printing Unicode box-drawing characters:
Using an ASCII separator preserves output formatting while ensuring compatibility across platforms and terminal encodings.
Validation
Notes