【发布时间】:2019-07-26 13:19:40
【问题描述】:
即使设置了 UTF-8 声明,德语变异元音(ö、ä、ü 等)也无法在电子邮件中正确显示,通过 html/php 联系人表单发送。
PHP 文件:
<meta http-equiv="Content-Type" content="text/html"; charset="utf-8" />
<?php
$name = $_POST['name'];
$email = $_POST['email'];
$message = $_POST['message'];
$from = 'From: Website';
$to = 'xxx@gmx.de';
$subject = 'Hi there';
$human = $_POST['human'];
$body = "From: $name\n E-Mail: $email\n Message:\n $message";
if ($_POST['submit']) {
if ($name != '' && $email != '')
在 html 文件中也设置了 utf 声明:
<!DOCTYPE html>
<meta charset="utf-8">
特殊字符看起来像这样“ü”
【问题讨论】:
标签: php html utf-8 contact-form