I have a PHP script that sends an email in spanish and I get strange characters instead of accents. I have tried the following headers: Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
(each line separeted by a \n) But I get strange chatacters where accents and other special characters are supposed to appear (áéíóúñ, etc).
How can I fix this?
I don't think it is the e-mail client, because I get e-mail in spanish from others and I can see the accents and all. I even copied the headers from those messages, but no luck.
Now I see why no one answered, it's not easy. The headers that have to be sent are: Mime-Type: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-encoding: 8bit
That's not enough. I have found that the extended ASCII set IS NOT the same for iso-8859-1. If I type an á (acute accented a), the ASCII code is 135. But to iso-8859-1, character number 135 is a ‡. This is where the problem begins. The á in iso-8859-1, is ASCII 255... go figure. I'm new to this, so I don't know if there is supposed to be any logic between these two charsets, fact is, you cannot get all iso-8859-1 characters by adding or substracting a fixed number to the ASCII number. I mean, if you add 135+90=255, but if you add 142 (é)+90=è.
I'm clueless, I'm starting to think that I have to map each individual character to make the appropiate "translation" so that these characters arrive readable by e-mail.
Any ideas? Can this be explained? Why fry my brain on this? because accented characters and other special characters are important in spanish, it is not the same "contraseña" than "contrasena" or "envío" to "envió", and I am sure other languanges need their own special characters too. Thanks.