Wrong encoding of city name in response

  • 1
  • Problem
  • Updated 4 years ago
I have queried latitude and longitude, and got the proper result, but the city name is wrongly encoded:
{
"type": "INTLCITY", "country": "HU", "country_iso3166": "HU", "country_name": "Hungary", "state": "", "city": "<b>Felsõörs",</b> "tz_short": "CET", "tz_long": "Europe/Budapest", "lat": "47.040000", "lon": "17.920000", "zip": "00000", "magic": "10", "wmo": "12830", "l": "/q/zmw:00000.10.12830", "requesturl": "global/stations/12830.html", "wuiurl": "http://www.wunderground.com/global/stations/12830.html",<br>...<br><br>It should have been "Felsőörs". When this character is replaced with&nbsp;õ, it shows wrong encoding. I am not sure whether you use 3rd party geocoding service, or these cities are just saved in database with wrong encoding.
Photo of Zsolt Nagy

Zsolt Nagy

  • 6 Posts
  • 0 Reply Likes

Posted 4 years ago

  • 1
Photo of Zsolt Nagy

Zsolt Nagy

  • 6 Posts
  • 0 Reply Likes
Also, when checking the main page, the nearby ws list is wrongly encoded too:
For example:
Beszédes JÃ3zsef sétány
When I click on it, it displays properly:  Beszédes József sétány
Photo of Tim Roche

Tim Roche, Official Rep

  • 317 Posts
  • 28 Reply Likes
Hi, 

We use google for some lat/lng searches.  I just checked and I am receiving the incorrect result
https://maps.googleapis.com/maps/api/geocode/json?latlng=47.04,17.93&language=hu

Which is strange since their own map lists it correctly.
Photo of Zsolt Nagy

Zsolt Nagy

  • 6 Posts
  • 0 Reply Likes
This is really messed up. I have changed the language to en in your url, and some occurrences of the city names are correct, some not (first 2 I think)
Photo of Zsolt Nagy

Zsolt Nagy

  • 6 Posts
  • 0 Reply Likes
https://maps.googleapis.com/maps/api/...
This one though seems ok, and I have also noticed that using your geolookup all the nearby stations were incorrectly encoded, as I have pointed out in my second post. When I click those links, they appear correcly. I think this has something to do with the geolookup query, since other types of queries seem to be working.
Photo of Zsolt Nagy

Zsolt Nagy

  • 6 Posts
  • 0 Reply Likes
When I run the utf8_decode() function on the strings in the response, they appear correctly. Is it possible that already utf8 encoded strings get utf8 encoded in your geolookup responses? Maybe they were saved that way in the database?
Photo of Tim Roche

Tim Roche, Official Rep

  • 317 Posts
  • 28 Reply Likes
we'll be transitioning to a new geo service at some point in the near future, hopefully this will solve the issue