http://topic.csdn.net/t/20041206/16/3619726.html

解决方案 »

  1.   

    当返回结果含有中文时,请尽量用xml作为信息的载体.要不会出现乱码
      

  2.   


    <%   
    Response.ContentType = "text/xml;charset=UTF-8"
    Response.Write(" <font   color=red>   结果完成   </font> ")  
    Response.End() 
    %> 
      

  3.   

    加了 Response.ContentType = "text/xml;charset=UTF-8" ,还是乱码能否给一个测试通过的例子。
      

  4.   

    加在顶部。
    <% response.charset="gb2312" %>
      

  5.   

    服务器端和客户端全部用utf-8编码
      

  6.   

    返回数据前加它就可以了   response.setCharacterEncoding("UTF-8");
      

  7.   

    1.html
    <script language="javascript">
     
    var sendStr="";
    sendStr="a=123456";
    var   xmlhttp=createXMLHTTP();
       
    xmlhttp.onreadystatechange=function(){

    if   (xmlhttp.readyState==4)
    {
    if   (xmlhttp.status==200)
    {
    document.getElementById("msg").innerHTML=xmlhttp.responseText;
    }
    }
    }
    xmlhttp.open("post","ztest.asp",true);
    xmlhttp.setRequestHeader('Content-type','application/x-www-form-urlencoded');
    xmlhttp.send(sendStr);
     
    </script><table border="0" cellspacing="0" cellpadding="0" width="500" align="center">
      <tr align=center height="8">
        <td id="msg"></td>
      </tr>
      <tr align=center>
        <td>测试</td>
      </tr>
    </table>2.asp
    <%
    Response.ContentType = "text/xml;charset=UTF-8"
    Response.Write(" <font   color=red>   结果完成   </font> ")
    Response.End() 
    %>结果:
    �����  
    娴嬭瘯 
      

  8.   

    http://blog.csdn.net/muxrwc/archive/2007/11/05/1867529.aspxhttp://blog.csdn.net/muxrwc/archive/2007/11/06/1869319.aspx可以看下这两篇文章
      

  9.   

    楼上的文章看过了,情况不一样,我只是从asp页面返回一个中文字符串。不是先将中文字符作为参数传过去,然后再把它返回来。
    还是要谢谢提供参考资料。
      

  10.   

    - -
    一样的不是么
    VBS也有escape
    你返回的时候把要返回的内容escape一下。。
    然后到JS接收的时候在unescape一下不就可以了么?
      

  11.   

    乱码都是编码的问题了。对xmlHTTP发送的编码不是很清楚,用escape进行编码再发送,页面编码一致用UTF-8就行了吧。
      

  12.   

    参考JavaScriptencodeURI 方法
    encodeURIComponent 方法两个方法有点点不同
      

  13.   

    2.asp 
    <%   response.charset="gb2312"   %> 
    <% 
    Response.Write("   <font       color=red>       结果完成       </font>   ") 
    Response.End()   
    %>