af83

Google Maps Geocoding API Weirdness, place names with accented characters problem

On one of our platforms that uses the geocoding services from the google maps api v2 (using client side javascript) we fell upon a very very weird bug.

For the same city google gives different answers based upon the presence of accents in the query string.

  1. When you look for Angoulême (the correct spelling, see the small hat upon the e? called accent circonflexe or by it's html entity name ê) Google's geocoding api gives the incorrect answer of angouleme without the accent.
  2. When you look for Angouleme (without the accent) it gives the same incorrect answer angouleme.
  3. But when you look for Angoulème (incorrect spelling with an 'accent grave') it outputs the correct answer angoulême !!!

You can test by using the following urls:

angouleme
http://maps.google.fr/maps/geo?hl=fr&oe=utf-8&q=angouleme%2CFR&key=<strong>REPLACE BY A VALID GOOGLE API KEY</strong>
angoulême
http://maps.google.fr/maps/geo?hl=fr&oe=utf-8&q=angoul%C3%AAme%2CFR&key=<strong>REPLACE BY A VALID GOOGLE API KEY</strong>
angoulème
http://maps.google.fr/maps/geo?hl=fr&oe=utf-8&q=angoul%C3%A8me%2CFR&key=<strong>REPLACE BY A VALID GOOGLE API KEY</strong>

The answers are extracted from the json section that looks like this: "SubAdministrativeArea":{"SubAdministrativeAreaName":"Charente","Locality":{"LocalityName":"Angoulême"}}

The same problems appears for other place names with accents but has not been thoroughly tested.

blog comments powered by Disqus