原始程式
<!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>無標題文件</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head><body>
<center>
<div class="content"><{include file="main_header.tpl.htm"}></div>
<div class="content_center"><{include file=$content}></div>
<div class="content"><{include file="main_footer.tpl.htm"}></div>
</center>
</body>
</html>可是Smarty編碼後
<!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>無標題文件</title>
<link href="style.css" rel="stylesheet" type="text/css" />
</head><body>
<center>
<div class="content">?<div class="header"></div></div>
<div class="content_center">?<div class="content_menu">aaa</div></div>
<div class="content">?<div class="footer"></div></div>
</center>
</body>
</html>
每個include前都出現了一個問號
在IE上看每個表格前會多空一行空格
IE用顯示原始碼再貼到UltraEdit
勾選顯示空格及定位字元才看到問號
在FIREFOX沒問題試過不用include把子樣版的程式直接PO上去,問號就不見了。
用include問號就會出現(IE)若改成BIG5就沒有問號出現
Smarty是不是不支援UTF-8還是另有辦法解決??
試了兩天還是沒辦法解決............是不是程式碼要用ANSI編碼
而中文字必須另外用一個語言檔(utf8格式)來include進來
這樣才不會有問題我看了一下phpbb他就是這樣的作法
可是這樣不就很麻煩