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

[FIXED] # UnicodeError while handling a bug #762

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

Z4nzu
Copy link

@Z4nzu Z4nzu commented Mar 4, 2023

This error occurs when there is an attempt to encode a Unicode character that is not in the ASCII range (i.e., outside the range of 0 to 127) using the ASCII codec. The character in question in your case is '\u2019', which is the right single quotation mark.

Encode the message using a Unicode encoding that supports all characters, such as UTF-8. You can do this by changing the encoding parameter of the encode() method to 'utf-8'
close #757

@Z4nzu Z4nzu changed the title [FIXED] # UnicodeError while handling a bug #757 [FIXED] # UnicodeError while handling a bug Mar 4, 2023
@Z4nzu
Copy link
Author

Z4nzu commented Mar 4, 2023

Hii @cclauss, Please Review PR

web/debugerror.py Outdated Show resolved Hide resolved
web/debugerror.py Outdated Show resolved Hide resolved
Co-authored-by: Christian Clauss <cclauss@me.com>
cclauss
cclauss previously approved these changes Mar 4, 2023
Copy link
Contributor

@cclauss cclauss left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Thanks for doing this.

@Z4nzu
Copy link
Author

Z4nzu commented Mar 4, 2023

Hi @cclauss, As I am checking lint_python cases are failed due to isinstance(). May I do that changes or how this PR will be merged ?

@cclauss
Copy link
Contributor

cclauss commented Mar 4, 2023

@iredmail @criptocoko Your reviews, please?

@criptocoko
Copy link

Does this solve the scenario i presented?? because i think the problem is only for the attachments, not the message. The message is already handled here:

self.message.set_payload(message, "utf-8")
. Correct me if im wrong.

I attached the 2 scenarios('non ascii on the attach and the non ascii on the message') where the first one fails and second doesn't.
web.py issue

@cclauss
Copy link
Contributor

cclauss commented Mar 4, 2023

This is exactly why tests are a great idea.

@cclauss
Copy link
Contributor

cclauss commented Sep 27, 2023

Please resolve the git conflict.

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.

UnicodeError while handling a bug
3 participants