Encoding Problems with Qype API + Android

Put your problem here if it does not fit any of the other categories.

Encoding Problems with Qype API + Android

Postby crashraider » Fri Jul 31, 2009 1:29 am

Hi, I have problems with the data returned by the API QYPE in Android.

The problem is that the accents and some characters do not show me, and I've seen that QYPE API returns the XML in UTF-8. I have tried to change the encoding in the request, but I have worked and will no longer be done.

The Code:

Syntax: [ Download ] [ Hide ]
Using java Syntax Highlighting
  1.                         URL url = new URL("http://api.qype.com/v1/positions/41.6508376,-0.882167/places?content_language=es&in_category=883");
  2.  
  3.                         HttpURLConnection request = (HttpURLConnection) url.openConnection();
  4.  
  5.                         consumer.sign(request);
  6.  
  7.                         request.addRequestProperty("Accept-Language", "Accept-Language: es");
  8.  
  9.                         request.setRequestProperty("Content-Type", "application/xml; charset=ISO-8859-1");
  10.  
  11.                         //request.addRequestProperty("Content-Type", "application/xml; charset=ISO-8859-1");
  12.  
  13.                         request.connect();
  14.  
  15.                         Log.d("CONTENT:",request.getContentType());
Parsed in 0.033 seconds, using GeSHi 1.0.8.4


CONTENT log shows me:

07-31 01:50:04.644: DEBUG/CONTENT:(1942): application/xml; charset=utf-8


What can I do? Any ideas? Thanks
crashraider
Freshman
Freshman
 
Posts: 2
Joined: Tue Jul 21, 2009 6:51 pm

Top

Return to Other Coding-Problems

Who is online

Users browsing this forum: No registered users and 16 guests