Monday, 15 March 2010

Google Geocode: PHP Implimentation - character encoding issues -


I am working with UK address data and international address data.

I need the Geocode address information for use on Google Maps I'm using this HTTP service Ie / build a query string and give it to file_get_contents ($ TheURL).

I have been able to geocode 80% of the fully-known data, although in countries like Norway and Sweden there are special characters, they will not return a geocode. Returned codes are 602 (no addres can not be found).

Seeing the document, I can see that the string sent to Google should be UTF 8 encoded.

I have tried the following to ensure that the string is UTF 8 encoded / special characters.

1) Using UTF 8 encode on query string - it often shows results in distorted characters appearing on the screen.

2) mb_check_encoding reports that the string is correctly encoded

3) Using the function to replace special characters for your European Union (Google API Compatibility in Hope

Can any reason suggest that why my method is not working or what to do with encoding?).

You should go through system settings in every encoding aspect

  • And the encoding defines what encoding it contains. Mb_detect_encoding and projected work is not a good way here.

    You will have to check their encoding:

    • Database Connection
    • Database Table Insertions
    • Script files you work with

    If defective letters are generated, then it is likely that You are using ISO-8859-1 or any other non-UTF-8 encoding anywhere. When everything clean UTF-8 should go through the request.

    There is a very good article on the basics.


No comments:

Post a Comment