Unicode to GB2312

 

//获取请求数据流
Stream stream=Request.InputStream;
//流读取器
StreamReader sr=new StreamReader(stream,Encoding.UTF8); 
//读取多有请求信息
string ss=sr.ReadToEnd();
//转换读取信息字符为字节数组
byte[] bs=Encoding.UTF8.GetBytes(ss);
//将字节数组转换为编码为GB2312的字符
string Content=HttpUtility.UrlDecode(bs,0,bs.Length,Encoding.GetEncoding("GB2312")); 

posted on 2005-07-27 16:19  Pierce  阅读(579)  评论(3)    收藏  举报

导航