• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 779
  • Last Modified:

Characters ÅÄÖ in contact form

Hi Experts!

I use this contact form:


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!
  • 2
1 Solution
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.


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.  
GodDoesntExistAuthor Commented:
Thank you!

I'll go for option #1 =)
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?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now