Created
January 23, 2023 06:12
-
-
Save WhiteCat6142/a6ca1f69fbef24ca5f20ca971a223c98 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# https://ideone.com/BLQ2FM | |
# https://blog.tmtms.net/entry/2015/12/07/mime-header-encoding | |
# https://docs.python.org/ja/3/library/email.message.html | |
from email.message import Message | |
from email.header import Header | |
msg = Message() | |
h = Header('MIMEヘッダエンコーディングは複雑すぎてつらい', 'utf-8',77,'Subject') | |
msg['Subject'] = h.encode() | |
print(msg.as_string()) | |
print(h.encode()) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment