日期:2014-05-17  浏览次数:20884 次

asp utf-8问题
<%
  const MaxPerPage=15
  dim totalPut  
  dim CurrentPage
  dim TotalPages
  dim i,j
  dim idlist
  if not isempty(request("page")) then
  currentPage=cint(request("page"))
  else
  currentPage=1
  end if
dim sql
dim rs
dim qymc
dim strUnit,sfilename
strUnit="信息"
  sql="select * from info2 where gsid='"+session("user")+"' and infotype='货源信息' order by AddTime desc"
sfilename="goods_Manage.asp"
  Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
  if rs.eof and rs.bof then
  response.write "<tr align=""center"" bgcolor=""#FFDBBF""><td colspan=""7"" bgcolor=""#FFCEAA"">还没有信</td></tr> </p>"



里面的INFOTYPE='货源信息'不好用,但把utf-8转成gb2312 就好用了。请高手指教。

------解决方案--------------------
统一编码
<%@ LANGUAGE = "VBScript" CodePage = "65001"%>
<%
Session.CodePage = 65001
Response.Charset = "utf-8"
%>

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

同时用文本打开文件另存为UTF8格式。
------解决方案--------------------
用记事本打开你的源文件,然后用utf-8格式重新保存一次就可以了。
------解决方案--------------------
LSD正解,关键就是要统一编码
------解决方案--------------------
yes 如果编码方式不同 容易出现乱码
------解决方案--------------------
最好是统一编码编写,还要最好是同一个编辑软件编写。。。