不在web.config中设置requestEncoding="gb2312" ,服务器控件提交数据中文为乱码,怎么转化例如在textbox"输入中国留学生普遍存在英语语言基础薄弱" 乱码为"йѧձӢԻ"
1.<META http-equiv="content-type" content="text/html; charset=gb2312"> 试过不行
2.HttpUtility.UrlDecode(中文, System.Text.Encoding.GetEncoding("gb2312"))也不行
3.用了方法如下,还是不行
static public string EnCodeBase64(string code_type, string code)
        {
            string encode = "";
            if (code_type == null)
            {
                code_type = "unicode";
            }
            if (code != null && code.Length > 0)
            {
                byte[] bytes = System.Text.Encoding.GetEncoding(code_type).GetBytes(code);
                try
                {
                    encode = Convert.ToBase64String(bytes);
                }
                catch
                {
                    //encode = code;
                }
            }
            return encode;
        }
请教正确答案

解决方案 »

  1.   

    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    改成这个试试
      

  2.   

    不需2和3的写法.照下面的步骤:在web.config中写上:
     <globalization fileEncoding="utf-8" requestEncoding="utf-8" responseEncoding="utf-8"/>然后,把页面这句<META http-equiv="content-type" content="text/html; charset=gb2312"> 删除.最后,把这页xxx.aspx和xxx.aspx.cs均另存为UTF-8
      

  3.   

    不在web.config中设置requestEncoding="gb2312" .标题已经写了
      

  4.   

    <!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=utf-8"/>
    <meta http-equiv="Cache-Control" content="no-cache"/>
    <meta http-equiv="Expires" content="0"/>
    <meta http-equiv="Pragma" content="no-cache"/>
      <meta http-equiv="imagetoolbar" content="no"/> 
    <meta content="MSHTML 6.00.2900.3157" name="GENERATOR"/>
    <title>测试框架</title>
    </head>换成我的这个试试