homepage Welcome to WebmasterWorld Guest from 107.20.25.215
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
Forum Library, Charter, Moderators: coopster & jatar k

PHP Server Side Scripting Forum

    
How to make accents show properly in mail sent by PHP
transistor




msg:1266046
 12:10 am on Dec 11, 2002 (gmt 0)

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.

 

transistor




msg:1266047
 6:39 pm on Dec 13, 2002 (gmt 0)

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 "contrasea" than "contrasena" or "envo" to "envi", and I am sure other languanges need their own special characters too.
Thanks.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / PHP Server Side Scripting
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved