【求助】網頁資料輸入輸出的中文顯示問題



贊助商連結


mos19
2005-06-17, 10:21 PM
請教各位大大一個問題。

小弟有一個測試網頁, test.htm, 是一個輸入的表單,如下:

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

<body>
<form name="form1" id="form1" method="post" action="test.asp">
<input name="name" type="text" id="name" />
<input type="submit" name="Submit" value="送出" />
</form>
</body>
</html>

此網頁是以 utf-8 編碼,而其執行的 test.asp 程式如下:

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

<body>
<%
name= request("name")
response.write name
%>
</body>
</html>

若在 test.htm 網頁中輸入 "中文測試" 或一些其他中文字,按送出之後的結果都會是亂碼。

為什麼會如此?是因為輸入的中文是 big5 而顯示出來的是 utf-8 的關係嗎?

有沒有什麼方法可以讓中文字正常顯示?


謝謝

贊助商連結


leonchou
2005-06-17, 10:27 PM
我聯想到 這個 (http://www.pczone.com.tw/showthread.php?t=139366) , 不知有沒有關係?

ckmarkhsu
2005-06-18, 12:48 AM
根big5 utf8無關

IE會自動轉換