Skip to content

There is no way to specify UTF-8 charset/encoding for localized messages #1224

Open

Description

@alekdavis

We are having an issue when sending localized HTML email messages. Although the messages are very short (a couple of sentences, title, header, footer, no embedded images or media), some of them get clipped by GMail. I am not 100% sure but it seems like only translations that include accented Latin characters get clipped and the ones that have extended Unicode characters are not. For example French, German, and Spanish translations get clipped, but Polish, Japanese, and Korean are not.

I suspect the issue is caused by the character encoding. When I download and check the message (EML) file, I see that the Content-Type headers differ:

CLIPPED: Content-Type: text/html; charset=iso-8859-1
NON-CLIPPED: Content-Type: text/html; charset=utf-8

So, the solution would be to force encoding to use UTF-8, but I do not see any properties or methods to do this. The workaround is to place an invisible extended Unicode character in the email template, but this sounds like a hack. Why is there no way to specify character encoding?

Activity

  1. ZeyangSun commented on Mar 20, 2026

    @ZeyangSun

    @alekdavis We have the same problem, anything went forward??

  2. alekdavis commented on Mar 20, 2026

    @alekdavis
    Author

    @ZeyangSun Nope. And frankly, I do not expect any resolution for this, since it has been reported before me a while ago. Use a workaround: https://alekdavis.blogspot.com/2026/01/why-does-gmail-clip-messages.html

  3. ZeyangSun commented on Mar 20, 2026

    @ZeyangSun

    @alekdavis Thanks a lot, really easy and brilliant way to solve the problem as so far. Then I got an inspiration based on your idea which is adding an unicode escape sequence "\u200B" to the htmlContent.

  4. alekdavis commented on Mar 20, 2026

    @alekdavis
    Author

    @ZeyangSun Just keep in mind that some preprocessors may get rid of the HTML comments. That's why I went with an invisible character.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions