54289632? Utm_source = blogxgwz6
Refer to the article about setting the encoding format GBK for Android composer fit2.1.0.
Okhttpclient. builder = new okhttpclient (). newbuilder ();/*** use the following line of code under Lyl todo to add an HTTPS interface to access ** // builder. sslsocketfactory (getsslsocketfactory (context); builder. addinterceptor (new interceptor () {@ override public response intercept (interceptor. chain) throws ioexception {request original = chain. request (); // request customization: add request headers // log. D (TAG, fdata); stringutil. encryptasdonet (fdata, 1) // log. D (TAG, "encrypted:" + desutils. encryptasdonet (fdata, 1); Request. builder requestbuilder = NULL; try {requestbuilder = original. newbuilder (). addheader ("androidorios", "android");} catch (exception e) {logutil. E (TAG, "--- create -- addhead ---" + E. tostring ();} request = requestbuilder. build (); Request = requestbuilder. post (requestbody. create (mediatype. parse ("application/X-WWW-form-urlencoded; charset = UTF-8"), urldecoder. decode (bodytostring (request. body (), "UTF-8 "))). build (); Return chain. proceed (request );}});
You can solve the problem.
When using fit to print logs, the Chinese characters will display characters similar to % E8 % be % BD