注册 登录
编程论坛 ASP技术论坛

asp 搜索出的关健字是乱码

mai_25 发布于 2010-11-17 10:40, 715 次点击
<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Response.CodePage=65001
Response.Charset="UTF-8"

dim types,key,dat,sdat,edat,stdat,eddat
types = trim(Request.Form("types"))
key = trim(Request.Form("key"))
dat = trim(Request.Form("dat"))
sdat = trim(Request.Form("starty"))&"-"&trim(Request.Form("startm"))&"-"&trim(Request.Form("starth"))
edat = trim(Request.Form("endy"))&"-"&trim(Request.Form("endm"))&"-"&trim(Request.Form("endh"))

if dat = "" then

if types=1 then
Response.Redirect("so_jd.asp?tit="&key&"")
elseif types=2 then
Response.Redirect("so_ms.asp?tit="&key&"")
elseif types=3 then
Response.Redirect("so_gw.asp?tit="&key&"")
elseif types=4 then
Response.Redirect("so_qy.asp?tit="&key&"")
elseif types=5 then
Response.Redirect("so_hd.asp?tit="&key&"")
end if

else

if types=1 then
Response.Redirect("so_jd.asp?tit="&key&"&sdat="&sdat&"&edat="&edat&"")
elseif types=2 then
Response.Redirect("so_ms.asp?tit="&key&"&sdat="&sdat&"&edat="&edat&"")
elseif types=3 then
Response.Redirect("so_gw.asp?tit="&key&"&sdat="&sdat&"&edat="&edat&"")
elseif types=4 then
Response.Redirect("so_qy.asp?tit="&key&"&sdat="&sdat&"&edat="&edat&"")
elseif types=5 then
Response.Redirect("so_hd.asp?tit="&key&"&sdat="&sdat&"&edat="&edat&"")
end if

end if
%>

当跳到相关页面关健就出现乱码
so_jd.asp?tit=灏忚タ澶?sdat=2010-11-1&edat=2010-11-8

测试地址:http://www.
2 回复
#2
longxuanxuan2010-11-17 12:16
Response.Charset="UTF-8"  相关页面也是 UTF-8吗  ? 改成GB2312 呢 
#3
dzt00012010-11-17 13:38
我测试正常的
1