Forecast in Russian returns bad JSON data

  • 1
  • Problem
  • Updated 6 years ago
When requesting a forecast in English, the JSON returned is fine. For example:

http://api.wunderground.com/api/YOURK...

However, when you make the same call with language set to Russian, bad JSON is returned. For example:

http://api.wunderground.com/api/YOURK...

You can see in the returned results that at the end of every fcttext and fcttext_metric nodes is the text:

This causes the json_decode function in PHP to fail.

Note that this text always says the same thing (end chance of precip) regardless of the actual weather conditions.

When this text is stripped out of the response, everything works as expected.

Thank you for your support!
Photo of dostoevskytrip

dostoevskytrip

  • 5 Posts
  • 0 Reply Likes

Posted 6 years ago

  • 1
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 122 Reply Likes
I see what you mean, we're looking into it.
Photo of dostoevskytrip

dostoevskytrip

  • 5 Posts
  • 0 Reply Likes
Thanks for the quick reply. I noticed that this post stripped the offending text because, I assume, it looked like PHP tags. Here it is (using html entities):

< ? END CHANCE OF PRECIP ?>

(hopefully that appears correctly. :) )
Photo of Brendan Hayes

Brendan Hayes, Official Rep

  • 962 Posts
  • 122 Reply Likes
Thanks, its been fixed now. Appreciate you pointing it out.
Photo of dostoevskytrip

dostoevskytrip

  • 5 Posts
  • 0 Reply Likes
Looks good, Brendan. Thanks for the speedy fix!