escape用法参考如下
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!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=gb2312" />
<script type="text/javascript">
<!--
var xmlhttp;
try{
    xmlhttp= new ActiveXObject('Msxml2.XMLHTTP');
}catch(e){
    try{
        xmlhttp= new ActiveXObject('Microsoft.XMLHTTP');
    }catch(e){
        try{
            xmlhttp= new XMLHttpRequest();
        }catch(e){}
    }
}
function getName()
{
        var id;
        id = document.getElementById("myid").value;
    xmlhttp.open("get","xmlhttp.asp?id="+id);
    xmlhttp.onreadystatechange = function(){
        if(xmlhttp.readyState==4){
            document.getElementById("myname").value =unescape(xmlhttp.responseText);
        }
    }
    xmlhttp.setRequestHeader("If-Modified-Since","0");
    xmlhttp.send(null);
}
//-->
</script>
xmlhttp.asp代码如下:
<%
Set conn=Server.CreateObject("ADODB.CONNECTION") 
conn.Open "Driver={Microsoft Access Driver (*.mdb)};DBQ="&Server.Mappath("sjnews.mdb") 
set rs = server.CreateObject ("adodb.recordset")
id=Request.QueryString("id")
sql="select  * from news where id="&id
rs.open sql,conn,1,1
if not rs.bof then
response.Write(escape(rs("laiyuan")))
end if %>

解决方案 »

  1.   

    http.responseText默认是使用utf8编码,你在被请求页面加
    <meta   http-equiv="Content-Type"   content="text/html;   charset=gb2312"   /> 
    或加header
      

  2.   

    <meta   http-equiv="Content-Type"   content="text/html;   charset=Shift_JIS"> 
    你这个定义的是什么编码?
      

  3.   

    Shift_JIS这个是日语显示的一种编码,这个是不能变的
      

  4.   

    <head></head>  之间加上request.setCharacterEncoding("utf-8");
    response.setCharacterEncoding("utf-8");
    并且在 page 中还应写上  pageEncoding="utf-8"  这样就OK了