|
I've checked into this further and the problem actually has to do with the data that is returned from google. If the request returns an address with an accent then the issue arises.
Just for reference our setup is as follows. We are using Civicrm 7822, Drupal 4.7, php 5.1.6, and mysql 5.0.22. here is a sample of google response that causes the problem. Note the accent is Montréal
<kml> <Response> <name>?7012 1er ave QC H2A3H7</name> <Status> <code>200</code> <request>geocode</request> </Status> <Placemark> <address>7012 1E AV, Montréal, QC, Canada</address> <AddressDetails Accuracy="8"> <Country> <CountryNameCode>CA</CountryNameCode> <AdministrativeArea> <AdministrativeAreaName>QC</AdministrativeAreaName> <Locality> <LocalityName>Montréal</LocalityName> <Thoroughfare> <ThoroughfareName>7012 1E AV</ThoroughfareName> </Thoroughfare> </Locality> </AdministrativeArea> </Country> </AddressDetails> <Point> <coordinates>-73.598195,45.554040,0</coordinates> </Point> </Placemark> </Response> </kml> Assuming that you have the iconv support compiled in, can you check whether adding the line
$string = iconv('ISO-8859-1', 'UTF-8', $string); between the getResponseBody() call and the simplexml_load_string() call in CRM/Utils/Geocode/Google.php fixes this for you? Works great, never thought of that. Will this be added to the next rev.
Thanks for your tests. As soon as I figure out a nice way to do this without depending on having the iconv support compiled in, I'll push it to 1.6.
Fixed in r7993.
Curtis, can you please check whether replacing CRM/Utils/Geocode/Google.php with the file from http://svn.civicrm.org/branches/v1.6/CRM/Utils/Geocode/Google.php works for you? Make the issue unverified for 1.8.
Assigning to Sameer for 1.8 verification.
|
||||||||||||||||||||||||||||||||||||||||||||||
What is the encoding of your CMS/user framework? Are you using Drupal or Joomla?