Liste des Groupes | Revenir à cl python |
"Loris Bennett" <loris.bennett@fu-berlin.de> writes:[...]"Loris Bennett" <loris.bennett@fu-berlin.de> writes:Cameron Simpson <cs@cskk.id.au> writes:On 01Nov2024 10:10, Loris Bennett <loris.bennett@fu-berlin.de> wrote:as expected. The non-UTF-8 text occurs when I do
>
mail = EmailMessage()
mail.set_content(body, cte="quoted-printable")
...
>
if args.verbose:
print(mail)
>
which is presumably also correct.
>
The question is: What conversion is necessary in order to print the
EmailMessage object to the terminal, such that the quoted-printable
parts are turned (back) into UTF-8?
OK, so I can do:
######################################################################
if args.verbose:
for k in mail.keys():
print(f"{k}: {mail.get(k)}")
print('')
print(mail.get_content())
######################################################################
prints what I want and is not wildly clunky, but I am a little surprised
that I can't get a string representation of the whole email in one go.
Les messages affichés proviennent d'usenet.