我在URL中传递参数时,页面上的标题栏就出现乱码(标题是读取的 cookies),页面中的其他文字没有乱码现象。
而URL不传递参数时,标题栏就不出现乱码。
不管这个参数是中文还是英文,均出现乱码。这是怎么回事呢
config.web里我已经写了
<globalization fileEncoding="gb2312" requestEncoding="gb2312" responseEncoding="gb2312" culture="zh-CN"/>标题的COOKIES是这样写的
if (Request.Url.Authority.ToString() == "www.wb.com")
            {
                Response.Cookies["title"].Value = "南京魏碑网";
            }读取COOKIES是这样写的
    <title><% Response.Write(Request.Cookies["title"].Value); %></title>

解决方案 »

  1.   

    if (Request.Url.Authority.ToString() == "www.wb.com") 
                { 
                    Response.Cookies["title"].Value = "南京魏碑网"; 
                } 
    Response.Cookies["title"].Value = "南京魏碑网"; 给汉字加密即可!
    我碰到类似问题,已解决!
      

  2.   

    Response.Cookies["title"].Value =Server.URLEncode("南方");
    读取COOKIES是这样写的 
        <title> <% Response.Write(Server.URLDecode(Request.Cookies["title"].Value)); %> </title> 
      

  3.   

    还有一个很奇怪的问题
    我用VS2005的方式浏览网页,就不会出现乱码,而用IIS6的方式浏览就出现了乱码。
      

  4.   

    三楼应该是正确的,你在试试。
    Response.Cookies["title"].Value = Server.UrlEncode("南方公园"); 
    <% Response.Write(Server.UrlDecode(Request.Cookies["title"].Value)); %>