Characters ÅÄÖ in contact form

Hi Experts!

I use this contact form:

http://www.bitrepository.com/a-simple-ajax-contact-form-with-php-validation.html

Works great, but this is for a Swedish web site, so I'll need to be able to post Swedish characters: åäö ÅÄÖ

I've tried to add HTML Doctype to all files. Didn't work. I can see the Swedish characters in the form if I echo some characters. But in the mail, they are all wrong.

Any ideas?

Thanks in advice!
LVL 3
GodDoesntExistAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

mostartCommented:
this is a very common problem. You have to possible ways of doing it none will make you very happy anyway.
Usually using UTF-8 encoding would be the best solution to solve with all "special" language dependent characters, but the problem is, not all email clients will display UTF-8 content the right way.
Therefore you could either:

1.) convert all special chars to their corresponding html entity and send emails coded as html emails.

or

2.) use the matching latin1-swedish.. encoding within all steps of your project. Means inside the Website header as well as within your email encoding.  
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GodDoesntExistAuthor Commented:
Thank you!

I'll go for option #1 =)
0
GodDoesntExistAuthor Commented:
I did it another way.

$message = htmlspecialchars($_POST['message']);
$message = utf8_decode($message);

I added the second line there, that seems to work... Is there any issue doing this way?
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
PHP

From novice to tech pro — start learning today.