Fix UnicodeEncodeError by ensuring UTF-8 encoding for file writes #69
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.
his pull request addresses an issue encountered when using the Grasp extension with non-English characters. Specifically, an error (UnicodeEncodeError) occurred when attempting to write characters that are not supported by the default encoding on Windows (cp1252).
Changes Made:
Updated the append_org function in the main.py file to explicitly use UTF-8 encoding when writing to the .org file.
Reason for Change:
Using UTF-8 encoding ensures that the application can handle a broader range of characters, including Greek letters and other non-ASCII characters. This enhancement improves the usability of the extension for users who work with scientific articles containing diverse character sets.
How to Test:
Capture a note with non-English characters (e.g., Greek letters like "α-actinin").
Verify that the note is written to the .org file without any errors.