Skip to content

Fix UnicodeEncodeError by ensuring UTF-8 encoding for file writes#69

Open
trunksn1 wants to merge 1 commit intokarlicoss:masterfrom
trunksn1:fix-unicode-error
Open

Fix UnicodeEncodeError by ensuring UTF-8 encoding for file writes#69
trunksn1 wants to merge 1 commit intokarlicoss:masterfrom
trunksn1:fix-unicode-error

Conversation

@trunksn1
Copy link

@trunksn1 trunksn1 commented Oct 5, 2024

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.

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