服务器设置编码为utf-8,可以参考:
string send_url = "https://api.weixin.qq.com/sns/userinfo?access_token=" + access_token + "&openid=" + open_id; string result = Utils.HttpGet(send_url); public static string HttpGet(string url) { WebClient wc = new WebClient(); wc.Credentials = CredentialCache.DefaultCredentials; wc.Encoding = Encoding.UTF8; string returnText = wc.DownloadString(url); if (returnText.Contains("errcode")) { log.Error(returnText); } return returnText; }
3.4正式版以上版本已经不存在乱码问题!
评一波