怎样使用C#将unicode的编码转换为gb2312
其实 web.config中就有配置
<globalization requestEncoding="gb2312" responseEncoding="gb2312" />
<!--<pages validateRequest="false"/>-->
<httpRuntime
maxRequestLength="20000"
/>c# 代码
Stream stream=Request.InputStream;
StreamReader sr=new StreamReader(stream,Encoding.UTF8);
string ss=sr.ReadToEnd();
byte[] bs=Encoding.UTF8.GetBytes(ss);
string cc=HttpUtility.UrlDecode(bs,0,bs.Length,Encoding.GetEncoding("GB2312"));
posted on 2005-12-24 16:41 来问(zljGood@hotmail.com) 阅读(3466) 评论(4) 编辑 收藏
