Skip to content

Conversation

maimorag
Copy link
Contributor

@maimorag maimorag commented Aug 7, 2024

Status

  • In Progress
  • Ready
  • In Hold - (Reason for hold)

Related Issues

fixes: link to the issue

Description

fix utf-8 with 8 bit according to a fix that hasn't been released yet of "gh-105285: Use UTF-8 on email content when CTE is '8bit' #105306
":
python/cpython#105306

Copy link

@eyalpalo eyalpalo left a comment

Choose a reason for hiding this comment

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

Nice
Can you attach a screenshot of the test failing with the same error as in the bug before your fix?

@maimorag
Copy link
Contributor Author

failed test without the fix:
image

please notice how decode_content returns the following:
'\\u8fd9\\u662f\\u4e00\\u4e2a\\u793a\\u4f8b\\u90ae\\u4ef6\\uff0c\\u7528\\u4e8e\\u6f14\\u793a\\u6307\\u5b9a\\u7684\\u6761\\u4ef6\\u3002\r\n\\u5b83\\u4f7f\\u7528\\u4e86 UTF-8 \\u7f16\\u7801\\uff0c\\u53ef\\u4ee5\\u652f\\u6301\\u591a\\u79cd\\u8bed\\u8a00\\u7684\\u5b57\\u7b26\\uff0c\\u5305\\u62ec\\u4e2d\\u6587\\u3002\r\n\\u795d\\u597d\\uff0c\r\n\\u53d1\\u4ef6\\u4eba'

instead of:
'这是一个示例邮件,用于演示指定的条件。\r\n它使用了 UTF-8 编码,可以支持多种语言的字符,包括中文。\r\n祝好,\r\n发件人'

@maimorag maimorag merged commit 89c1533 into master Aug 12, 2024
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.

3 participants