Skip to content

gh-105285: Use UTF-8 on email content when CTE is '8bit' #105306

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

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

Conversation

michaelfm1211
Copy link

@michaelfm1211 michaelfm1211 commented Jun 5, 2023

When getting the payload of an email using
email.message.Message.get_payload() and passing decode=True, attempt to use UTF-8 if the Content-Transfer-Encoding header is '8bit'.

When getting the payload of an email using
email.message.Message.get_payload() and passing decode=True, attempt to
use UTF-8 if the Content-Transfer-Encoding header is '8bit'.
@ghost
Copy link

ghost commented Jun 5, 2023

All commit authors signed the Contributor License Agreement.
CLA signed

@michaelfm1211
Copy link
Author

Just came back to check on this, and it seems the documentation preview check hasn't passed even though there is no documentation to be built. I don't believe this change would require any documentation changes, as it's a bug fix.

Copy link
Member

@serhiy-storchaka serhiy-storchaka left a comment

Choose a reason for hiding this comment

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

UTF-8 is not always the right encoding. It should be self.get_param('charset', 'ascii').

@maimorag
Copy link

maimorag commented Aug 6, 2024

hey @michaelfm1211 @serhiy-storchaka,
what is the estimated time for the fix to be released?

@lorenzomorandini
Copy link

Hi, news on this? I'm currently facing the same problem and the fix seems to work.

@michaelfm1211
Copy link
Author

@lorenzomorandini Sorry, I kind of just forgot about this PR a few months ago when I was busy with work. I'll try to address the review today.

@python-cla-bot
Copy link

The following commit authors need to sign the Contributor License Agreement:

CLA signed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants