Convert ASCII Database Postgresql return to UTF-8 in Java Ksoap

Asked

Viewed 308 times

2

Have app Android that consumes from a webservice where the database is Postgresql and the ASCII type. When I try to print the string returned in the app he defaults the lyrics with accentuation, for example, Pulmão = Pulm?o.

Should I do this conversion on the service or client and what is the command for the case? And I must set something up in Eclipse IDE to accept this command?

Example:

  1. My Webservice which is in java makes the query in the postgres database (ASCII) and returns a string/object with the fields. These fields are set in a person type object for example.
  2. This object is consumed by the Android application for later viewing. Then if I search the data of the person and came the "John", the "ã" is printed on the disfigured screen. Eclipse is set to UTF-8, so I’m not sure how to handle this problem. I have tried (getbytes(). forname("UTF-8") and others, but error in syntax.

Stretch of return on application:

HttpTransportSE Transport = new HttpTransportSE(URL);
Transport.debug = true;

Transport.call(SOAP_ACTION, envelope);

//Recebendo retorno do Webservice

SoapObject response = (SoapObject)envelope.bodyIn;
  • You could edit the question with your http method?

  • Hello Wellington, the application is in java. I edited the question to see if it is clearer.

  • See if this help you

  • I work with KSOAP2. It follows excerpt of the return code in the application edited in the question.

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.