我要提交一些数据到一个接口,对方中文是采用GB形式的,而.net默认是UTF8编码的,对方接收到我提交过去的中文全是乱码,我把数据转换成GB2312编码后byte[]还是不行,大家帮我看看.
注意,是对方接收的中文为乱码!!!System.Net.WebClient wc = new System.Net.WebClient();
byte[] buffer = wc.UploadData(serverurl , "POST" ,System.Text.Encoding.GetEncoding("GB2312").GetBytes(postData));
string result = System.Text.Encoding.GetEncoding("GB2312").GetString(buffer);