Problem with specials characters and php
When my form is filled out with special characters I get a mail with strange characters eventhough I have set the charset to UTF-8. I made a test form as example, if you like to have a try.
Can someone tell me how I can force the form to display the characters correctly?
The problem is in the php script, line 14: (élève / élève) should display the word élève on the mail that I get.
HTML Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>test specials characters</title>
</head>
<body>
After filling out this form, a mail will be sent .
<form name="test" action="test1.php" method="POST">
<div>
<table border="0" cellspacing="0" cellpadding="0">
<tr>
<td>Enter
élève<br />
<input type="text" name="name" size="40" /><br /></td>
</tr>
<tr>
<td>email<br />
<input type="text" name="email" size="40" /></td>
</tr>
<tr>
<td><input name="submit" type="submit" value=" send " />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>
And the reply script:
PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
$email = $_POST['email'];
$name = $_POST['name'];
// Print the message.
print " Thank you, you enter élève";
// Send the email.
$body = " You have enter $name (élève / élève), thank you ";
mail ("$email,mymail@gmail.com", 'test specials characters', $body);
?>
</body>
</html>