Best answer

Wrong HTML charset when getting mail body in Gmail

  • 14 March 2023
  • 5 replies
  • 1106 views

Userlevel 1

 Whenever I’m getting an email body from gmail, the HTML-charset seems to be off. But only for the Body Plain. All the “raw” formats displays correctly.

 

We’re getting an email from a partner site, whenever someone signs up there to receive information from us regarding a product. We then send an email with the requested information directly to the email, the costumer provided. I’ve automated this so that a draft is created automatically with the proper attachments that ideally in 99% of cases only requires us to press send.

 

However, we get the following problem:

Since we are based in Denmark, we use æ,ø,å in our communications. This includes product and costumer names, so pretty important.

But for some reason those characters do not display properly for the “Body Plain” and “Body HTML”:

The “Raw Snippet” and other “Raw-” options display correctly though. Unfortunately, there is no “Raw Body”.

 

Usually when something like this occurs, it would have to do with a wrong charset (likely ASCII instead of UFT-8) being used in decoding the html. So I have some idead what the problem is.

 

But how can you change that in Zapier? Preferably automatically and preferably without needing 6 extra steps.

icon

Best answer by SamB 15 March 2023, 11:27

View original

This post has been closed for comments. Please create a new post if you need help or have a question about this topic.

5 replies

Userlevel 7
Badge +11

Hi @Steffen, thanks so much for reaching out about this! 🙂

Well that’s certainly not ideal at all! What’s it saying in the Content-Type field for the Gmail trigger? Is it saying it’s text/html; charset=UTF-8? Or is it saying it’s encoded as something else, like iso-8859-1?

Also, if you change the Body Type on the Gmail action to HTML and does that render the characters correctly? Just wondering if that might allow it to encode the characters correctly when the email is sent. 

Looking forward to hearing from you!

Userlevel 1

Hi @Steffen, thanks so much for reaching out about this! 🙂

Well that’s certainly not ideal at all! What’s it saying in the Content-Type field for the Gmail trigger? Is it saying it’s text/html; charset=UTF-8? Or is it saying it’s encoded as something else, like iso-8859-1?

Also, if you change the Body Type on the Gmail action to HTML and does that render the characters correctly? Just wondering if that might allow it to encode the characters correctly when the email is sent. 

Looking forward to hearing from you!

 

Hi Sam,

 

Thanks for the swift reply. The trigger has the following when I run “test trigger”:

 

and then later 

 

The rendering is also wrong for “body_html”, as you can see there

Userlevel 7
Badge +11

Thanks for getting back to me @Steffen

I’ve done some testing in my own account and used a Zap to send me an email (with the Body Type set to plain not HTML) with Ææ Øø Åå ß characters, then pulled that in as a sample in the Zap and selected the same Body Plain and Raw Snippet fields and they are appearing correctly with the content type of UTF-8:
6c6e6df0d4fb9562c1a0a81995d4fd00.png
So it looks like we’re able to send the characters correctly but are having trouble processing them when they come in encoded as iso-8859-1. I did some further investigation on this side and found a bug reported where it seems emails that are encoded in anything other than UTF-8 are being incorrectly decoded. So I’ve added you to the list of users being affected by that issue. I don’t have any ETAs to share on when that will be resolved but we’ve got your details logged so we’ll be able to contact you the moment it’s fixed.

In the meantime, is there anyway to change or force the encoding on the emails that are coming from the partner website? If not, does forwarding the emails to another email address that you own change the encoding that’s used? If it does, I’m wondering whether you could set up a rule in your email inbox to automatically forward those sign up emails and then you could change the Zap to trigger from the forwarded emails instead.

If that works or you’re able to find a different workaround here please let us know!

Userlevel 1

Thanks for getting back to me @Steffen

I’ve done some testing in my own account and used a Zap to send me an email (with the Body Type set to plain not HTML) with Ææ Øø Åå ß characters, then pulled that in as a sample in the Zap and selected the same Body Plain and Raw Snippet fields and they are appearing correctly with the content type of UTF-8:
6c6e6df0d4fb9562c1a0a81995d4fd00.png
So it looks like we’re able to send the characters correctly but are having trouble processing them when they come in encoded as iso-8859-1. I did some further investigation on this side and found a bug reported where it seems emails that are encoded in anything other than UTF-8 are being incorrectly decoded. So I’ve added you to the list of users being affected by that issue. I don’t have any ETAs to share on when that will be resolved but we’ve got your details logged so we’ll be able to contact you the moment it’s fixed.

In the meantime, is there anyway to change or force the encoding on the emails that are coming from the partner website? If not, does forwarding the emails to another email address that you own change the encoding that’s used? If it does, I’m wondering whether you could set up a rule in your email inbox to automatically forward those sign up emails and then you could change the Zap to trigger from the forwarded emails instead.

If that works or you’re able to find a different workaround here please let us know!

Thanks for your reply.

 

I’m working on a different solution, where I use the Excel function “SUBSTITUTE(A1;”æ”;”æ”)” to replace the gibberish with the appropriate symbols. I use an Excel table anyway for parsing, but it’s a bit more cumbersome that way, and I of course have to code for each specific symbol. Since the problem is mostly with the three characters mentioned (upper- and lowercase) it is manageable.

Userlevel 4
Badge +6

Hi @Steffen 

I’m glad you have a workaround but I’m sorry that it was a bit cumbersome. Rest assured that your vote has been added to the bug report, so once it is fixed, we will notify you!