2011-10-16 18 views
1

加载内容时,Firefox(Ubuntu,Windows,MacOs)显示第二个不正确的字符集(即捷克字母)。加载内容时,它会显示正确的字符集。 正确加载时,Safari,Explorer,Opera显示标签。Firefox中的Tab在加载时显示不正确的字符集

HTML报头是

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> 
<html> 
<head> 
<link rel="shortcut icon" href="favicon.ico"> 
<title><?=$lang_header_dict;?></title> 
<meta name="description" content="<?=$lang_head_description?>"> 
<meta name="keywords" content="<?=$lang_head_content?>"> 
<meta name="author" content="<?=$lang_head_author?>"> 
<meta http-equiv="X-UA-Compatible" content="IE=7"> 
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"> 
<link rel="stylesheet" type="text/css" title="hvalur" href="style.css"> 
<script type="text/javascript"> 
function setfocus() { 
document.form1.search_string.focus(); 
} 
function popitup(url) { 
newwindow=window.open(url,'name','height=400,width=800, scrollbars=yes'); 
if (window.focus) {newwindow.focus()} 
return false; 
} 
</script> 
</head> 

标题包含捷克国家characaters。

+0

测试用例链接?我猜你没有在HTTP响应中指定字符集。 – Nickolay

回答

0

配售meta标签

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

<title><?=$lang_header_dict;?></title>

显示正确的字符集和民族特色。

1

即使使用标题行之前的meta行,您的页面的charset可能会被Apache的默认字符集覆盖。这是设计。

为了解决这个问题,以下内容添加到您的配置文件:

AddDefaultCharset Off 

参见:http://padawan.info/en/2004/07/debugging-chars.html