元音突变在某些设备上不正确

时间:2015-04-27 17:26:53

标签: php internationalization diacritics

我来自德国,我们在这里得到了元音突变(ä,ü,ö等)。问题是,当通过联系表单接收电子邮件时,这些在某些设备(主要是移动电话)上无法正确显示。我使用以下PHP代码

<meta http-equiv="Content-Type" content="text/html"; charset="utf-8" />

<?php 
$errors = '';
$myemail = 'emailadress@email.com';
if(empty($_POST['name'])  || 
   empty($_POST['email']) || 
   empty($_POST['message']))
{
    $errors .= "\n Error: all fields are required";
}

$name = $_POST['name']; 
$email_address = $_POST['email']; 
$message = $_POST['message']; 

if (!preg_match(
"/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$/i", 
$email_address))
{
    $errors .= "\n Error: Invalid email address";
}

if( empty($errors))
{
	$to = $myemail; 
	$email_subject = "Sie haben eine neue Nachricht von: $name";
	$email_body = "Sie haben eine neue Nachricht erhalten, hier sind die Details: \n\nName: $name \nEmail: $email_address \nNachricht: \n$message"; 
	
	$headers .= 'From: <WSC Kontaktformular>' . "\r\n";
	$headers = "Reply-To: {$email_address}";
	$headers = "MIME-Version: 1.0";
	$headers = "Content-type: text/plain; charset=iso-8859-1";
	
	mail($to,$email_subject,$email_body,implode("\r\n",$headers));
	//redirect to the 'thank you' page
	header('Location: contact-form-thank-you.html');
} 
?>

您是否知道为什么移动设备出现问题但桌面电脑或笔记本电脑出现问题?

0 个答案:

没有答案