What about the garbled query from the custom menu in Wechat development?
This article is about how to customize menu query garbled in Wechat development. The editor thinks it is very practical, so share it with you as a reference and follow the editor to have a look.
The result returned by the query to get the custom menu is garbled
Solution:
String Posturl = "https://api.weixin.qq.com/cgi-bin/menu/get?access_token=Token";// sets relevant parameters for submission HttpWebRequest request = WebRequest.Create (Posturl) as HttpWebRequest;// submission method request.Method =" Get "; / / Encoding format request.ContentType =" text/html;charset=UTF-8 "; HttpWebResponse respone = (HttpWebResponse) request.GetResponse (); StreamReader stream = new StreamReader (respone.GetResponseStream (), Encoding.UTF8); string jsonstring = stream.ReadToEnd ()
In the end, there will be no garbled code, and UTF8 should be used when decoding the stream.
StreamReader stream = new StreamReader (respone.GetResponseStream (), Encoding.UTF8)
Thank you for reading! This is the end of this article on "how to customize menu query garbled in Wechat development". I hope the above content can be of some help to you, so that you can learn more knowledge. If you think the article is good, you can share it out for more people to see!