Encoding issue in Mailchimp

I created the Mailchimp template for the email newsletter of the company I work for. There is a problem with some links, and I cannot figure out how to fix them.

I add the link to the email like this:

<a href="http://www.nameofcompany.com/contact-us.php" target="_blank">Contact Us</a> 

And the link looks fine, but when you click on Gmail you get to page 404 of the site, even if the URL (on the surface) is correct.

After clicking the link, the URL displayed in the address bar is http://www.nameofcompany.com/contact-us.php , which is the correct URL and which, when entered into the address bar, goes directly to the correct page. But when I go to this URL from email, copy and paste it from the address bar into a new letter in Gmail, I see: http://www.nameofcompany.com/contact%E2%80%90us.php

So this seems to be a character encoding problem. I don’t even know how to fix it.

Here doctype, charset, etc. from an HTML email message.

 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> 

The strangest thing is that most email URLs work just fine, even those with a dash.

What causes this problem and how to fix it?

Greetings

+4
source share
3 answers

Ok, corrected. I found a template on Mailchimp and used "Edit this template code" to edit the HTML in my browser. Then I found the tag that caused the problems, deleted it, and dialed it again. A bit of a rough fix, and I'm not sure why the problem arose, but it worked!

+1
source

E2 80 90 is a Unicode byte sequence for a multibyte hyphen, and you must use ASCII. Which application. Do you use to encode your html files? This is due to hyphen encoding. Try using a plain text font if you are provided with this option in a code editor (for example, Courier).

0
source

I don’t know why the hyphen was encoded in 3 bytes here - usually the non-alpha / num characters in the URL are encoded in one byte.

Try replacing the hyphen with% 2D, so the hyphen will not be converted to% E2% 80% 90.

0
source

Source: https://habr.com/ru/post/1442791/


All Articles