Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UnicodeEncodeError #68

Open
trunksn1 opened this issue Oct 5, 2024 · 0 comments
Open

UnicodeEncodeError #68

trunksn1 opened this issue Oct 5, 2024 · 0 comments

Comments

@trunksn1
Copy link

trunksn1 commented Oct 5, 2024

First of all, I like this extension very much!

I'm using it to store fleeting notes of scientific articles I read. However, I've encountered a significant issue when trying to grasp strings containing non-English characters.

For example, if I try to grasp the string "protein α-actinin", I receive the following error:

Traceback (most recent call last):
  File "C:\Users\trunk\AppData\Roaming\Python\Python310\site-packages\grasp_backend\__main__.py", line 125, in do_POST
    self.handle_POST()
  File "C:\Users\trunk\AppData\Roaming\Python\Python310\site-packages\grasp_backend\__main__.py", line 110, in handle_POST
    res = capture(**payload)
  File "C:\Users\trunk\AppData\Roaming\Python\Python310\site-packages\grasp_backend\__main__.py", line 90, in capture
    append_org(
  File "C:\Users\trunk\AppData\Roaming\Python\Python310\site-packages\grasp_backend\__main__.py", line 35, in append_org
    fo.write(org)
  File "C:\Users\trunk\AppData\Local\Programs\Python\Python310\lib\encodings\cp1252.py", line 19, in encode
    return codecs.charmap_encode(input,self.errors,encoding_table)[0]
UnicodeEncodeError: 'charmap' codec can't encode character '\u03b1' in position 242: character maps to <undefined>
127.0.0.1 - - [05/Oct/2024 17:18:36] "POST /capture HTTP/1.1" 500 -

It seems that the issue arises from using characters like the Greek letter α. The encoding cp1252 cannot handle these characters, leading to a UnicodeEncodeError.

Is there a way to ensure that the extension supports Unicode characters, such as those used in non-English languages (e.g., Greek, accented letters, etc.)?

This is crucial for my workflow since I often work with scientific terms that include these symbols.

Thank you for your help and for developing this great tool!

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

No branches or pull requests

1 participant