Today, I debugged the online interface, and found that the Chinese characters (such as the payment bank and payment status) in the returned values are all garbled. I wanted to refer to the encoding problem. When I called customer service, the technology was not working, the so-called 7*24-hour service means that a customer service can answer the phone number within 7*24 hours (what is the use of the phone number? The problem cannot be solved). It is depressing.
Google is still the best teacher. I searched for it and found that someone said the Returned Code was gb2312, and someone said it was GBK. So I had to try it all. It turns out that it was GBK.
So I wrote a code segment to process the payment result data from online post of online banking:
Streamreader sr = new streamreader (request. inputstream, encoding. getencoding (936 ));
String query = Sr. readtoend ();
System. Collections. Specialized. namevaluecollection reqresult = httputility. parsequerystring (query, encoding. getencoding (936 ));
V_pstring = reqresult ["v_pstring"];
V_pmode = reqresult ["v_pmode"];