1

I'm doing mailings, which contains html code. If I check my HTML in IE or FF, everything looks great. But when I sent the mail, the characters become very weird:

In browser: Information générale ,In E-mail : Information g�n�rale

My HTML meta: <meta http-equiv="content-type" content="text/html; charset=UTF-8">

Clearly this has something to do with the encoding, but I don't get why it looks OK in a browser and not in the email...

I have other HTML emails (newsletters received from other persons) which use the same HTML meta, and those emails look just fine..

quintroo
  • 75
  • 1
  • 8
  • Look for the `Content-Type` header in the message source. – Alicia Jan 30 '14 at 14:22
  • Hi ntrrgc, this is the Content-Type: multipart/alternative; – quintroo Jan 30 '14 at 14:26
  • That's because you are sending a multipart message (one which contains e.g. both plain text and HTML). Each part has its own `Content-Type`. One of them should be something like `Content-Type: text/html; charset=UTF-8`. – Alicia Jan 30 '14 at 14:31

2 Answers2

1

� is an indication that the browser/E-Mail client uses UTF-8 to render the document, but encountered an invalid character from a different encoding.

It isn't enough to set the content-type meta tag; your data actually needs to match the encoding you're declaring.

If it comes from a file, make sure the file is encoded as UTF-8 (usually, the editor will offer you a setting in the "Save as...." dialog.)

If it comes from a database, see UTF-8 all the way through

Community
  • 1
  • 1
Pekka
  • 442,112
  • 142
  • 972
  • 1,088
0

In the email you have one more place to add an encoding: - The mail header - the mine header - if content is text/HTML in the HTML header

All of these need to be set right.

Sorry for short answer. Writing this on my cellphone.

Tobi
  • 1,175
  • 1
  • 19
  • 44