Wednesday 15 February 2012

java - Yummly API returns strange characters in JSON response (Android) -


I use the Yummly database by using HTML queries for recipes in my Android app:

  Http://api.yummly.com/v1/api/recipes?_app_id=MY-APP-ID_app_key=MY-APP-KEY&q=KEYWORD   

even if Their documents show that the GET requests come back in UTF-8 format, I get some strange characters in the code, such as: utensils de cream one L & RCO; Orange .

The problem is not limited to my Android app, but it is shown in Chrome browser. Curiously, when I tried to open it in Internet Explorer, it looked fine: cream of pottery is an orange , but crÄ? I'm fraÄ®®C , which is sometimes used in Chrome as CR & amp; Agrev; Me fry and icirc; C appears in the form of and sometimes correctly Crème Fraîche .

What is the difference between browsers that analyze them in different ways? And, more importantly, what can be done to eliminate this issue in Android / Java? Do you have an idea?

On Android I use HttpGet to fetch data from the server and then pass it on to some JSONObject.

I work for Jemli, the way we handle these things, there was inconsistency in it, But now it should be decided.

Through explanations, & amp; Syntaxs are SGML / XML / HTML entities that are used to avoid some characters. For example, for users of most browsers, see Document & amp; Or & amp; Amp; It does not matter and so we were not completely enough to normalize them. But for the app like you, obviously it makes a difference and we have added a more thorough generalization

For reference, there is an easy Java utility for this type of thing

No comments:

Post a Comment