为什么中文字符是乱码?

royrandy royrandy 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
其中strSend包含中文字符,但是发送上去的时候发送的内容中的中文就变成乱码了,该怎么解决呢?
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(strSend);
HttpWebResponse HttpWResp = (HttpWebResponse)myReq.GetResponse();
Stream resStream=HttpWResp.GetResponseStream();
string strXml="";
if (resStream!=null)
{
StreamReader sr =new StreamReader(resStream ,System.Text.Encoding.GetEncoding("GB2312"));
strXml =sr.ReadToEnd();
sr.Close();
}
HttpWResp.Close();
return strXml;
...全文
评论 12
收藏 已收藏
分享
返回顶部
royrandy
.NET社区 62,275 成员 668,968 内容