HttpWebResponse乱码问题
我想用HttpWebResponse把一串参数传给另一个ASPX页面,
byte[] buf = new byte[38192];
HttpWebRequest request = (HttpWebRequest)WebRequest.Create( "http://****/abc.aspx?a=中&b=国 ");
HttpWebResponse response = (HttpWebResponse)request.GetResponse();
但是传到abc.aspx这页里面,得到的参数全部都是乱码,怎么办??
[解决办法]
你是GB2312编码,这样
即可
HttpWebRequest request = (HttpWebRequest)WebRequest.Create( "http://****/abc.aspx?a= "+System.Web.HttpUtility.UrlEncode( "中文 ",System.Text.UnicodeEncoding.GetEncoding( "Gb2312 ")));