in reply to Re: Character encoding in emails
in thread Character encoding in emails

In this case, the code came from ChatGPT, which inserted an emoji into its output. The lines of text from ChatGPT were wrapped in HTML tags and passed to the email sending processes. Identical input text with identical emojis was passed to both processes.

That may be just something on the recipient's end

For testing purposes, I am the recipient. On my mobile email client and on Outlook for desktop, emails sent through the queue display the emoji and ones sent directly don't.

Replies are listed 'Best First'.
Re^3: Character encoding in emails
by NERDVANA (Priest) on Dec 07, 2023 at 23:09 UTC
    So, then your questions to answer are:
    1. What was the encoding of the data you received from ChatGPT?
    2. Did you store it in a unicode-aware database column type and with unicode enabled on the DBI connection?
    3. Did you read it back out with unicode enabled on the DBI connection?
    4. What was the encoding of the strings containing your HTML?
    5. What encoding did your MIME construction code expect?

    and my standard suggestion is to make sure you decoded bytes into unicode from the moment it enters your program until the time it exits your program (or in this case, until the time that you construct the MIME, because MIME should always be 7-bit ascii)