I m working with UK address data and also International address data.
I need to geocode the address data for use on a google map. I m doing this using the HTTP service. Ie/ Constructing a query string and passing it to file_get_contents($THEURL).
I ve managed to geocode 80% of the address data perfectly, however those addresses in countries like Norway and Sweeden that contain special characters will not return a geocode.The code returned is 602 (cannot find an address).
Looking into the documentation I can see that the string sent to google must be UTF8 encoded.
I ve tried the following to ensure the string is UTF8 encoded / remove the special characters.
1) Using UTF8 encode on the query string - this often results in malformed characters being displayed on the screen.
2) mb_check_encoding reports the string is correctly encoded.
3) Using a function to substitue special characters for thier europiene eqivilents (in the hope google api will compensate.
Can anyone suggest a reason why my method isn t working (whether to do with encoding or not?).