-
Senior Member
Sending mail using as and php.
Hi. I have this contact form where i use as and php to send mails from the site .
My problem is that the site is norwegian, and we have three special characters ( æ, ø and å ).
Now... when i write these into the form everything's ok, but when i send them using the php, these characters is messed up by the time i receive them in my mail. (e.g. "å" is converted to "Ã¥")
Does anybody know how i can fix this?
Thanks alot!
-
Hi Magnus
This looks like an encoding problem. Perhaps PHP is handling this as an ASCII or UTF-7 string. You want to handle it as a UTF-8 or similar (which contains more characters like european accents, etc). Due to the fact I haven't used PHP for a while I'm not exactly sure how to set this. Perhaps you could modify the PHP script so that it writes to a text file, and see if you get the same results. If you don't then it may be the encoding in the email.
Sorry I can't help any more, but maybe it will point you in the right direction?
HTH
If it ain't broke, don't fix it.
-
This, in the PHP script, will decode the variable $message. Just change it for your own PHP variable.
$message=utf8_decode($_POST['message']);
gparis
-
Senior Member
That works great!
Thanks alot, both of you!
-
Hi Magnus
This looks like an encoding problem. Perhaps PHP is handling this as an ASCII or UTF-7 string. You want to handle it as a UTF-8 or similar (which contains more characters like european accents, etc). Due to the fact I haven't used PHP for a while I'm not exactly sure how to set this. Perhaps you could modify the PHP script so that it writes to a text file, and see if you get the same results. If you don't then it may be the encoding in the email.
Sorry I can't help any more, but maybe it will point you in the right direction?
HTH
If it ain't broke, don't fix it.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|