genkgo / mail

Library to send e-mails over different transports and protocols (like SMTP and IMAP) using immutable messages and streams. Also includes SMTP server.
https://mail.readthedocs.io/
Other
402 stars 21 forks source link

UTF-8, invalid characters as a result of AlternativeText #59

Closed joca2 closed 4 years ago

joca2 commented 4 years ago

Hello when I use UTF-8 and

$ message = (new FormattedMessageFactory())
                 ->withHtml(<p>zażółć gęślą jaźń</p>) ...

I have invalid characters in alternative text. The problem is probably in AlternativeText::fromHtml($html) which uses: DOMDocument->loadHTML() which recodes characters. regards

frederikbosch commented 4 years ago

I added a test for it, but it does not lead to any bugs, see the test where this HTML is correctly transformed into this alternative text.