我在stackoverflow上看到很多有这些问题的线程,但是我找不到任何对我的问题的答案。 我随时随地看到德语变音符号,并将它们视为“特殊字符”。在html中使用德语变音词
这是我实现:
<?php
session_start();
error_reporting(E_ALL & ~ E_NOTICE);
require ("plugins/phpmailer/...");
require ('plugins/phpmailer/...');
require ("include/...");
require ("include/...");
require ("include/...");
?>
<html lang="de">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<link rel="stylesheet" type="text/css"
href="css/...">
<script src="http://code.jquery.com/jquery-latest.min.js"
type="text/javascript"></script>
<script src="javascript/..."
type="text/javascript">
</script>
</head>
<body>ähm...
此代码不能正常工作。我看到一个特殊的字符,但不是ä或什么...... 我的代码有什么问题?
对不起,这个问题,但我找不到任何聪明的解决方案。
您是否检查过*文件*是否在服务器上另存为utf-8?并检查您的网络服务器是否因为某些原因而发送相反的标题。 –
或者,如果您从数据库中获取数据,则应该执行SET NAMES UTF8。 – krasipenkov
谢谢Franz!这就是原因!数据库格式正常,但文件格式不正确。看起来好像它是unicode。在UltraEdit 15中,我完全无法识别这个绝对。菜单项文本是“unicode/utf8到utf8”。嗯,好吧,现在它是完美的!谢谢! – peter70