schilly Posted October 3, 2008 Share Posted October 3, 2008 I'm trying to build a map according to where all my users live. Currently I am trying to generate a KML file of the users location by getting the geocode data from google using simple_xml_load. Going off this tutorial: http://code.google.com/apis/maps/articles/phpsqlgeocode.html#samplecode My first few queries work ex. http://maps.google.com/maps/geo?output=xml&key=google_key&q=Vancouver%2C+BC%2C+Canada but it dies when it hits: http://maps.google.com/maps/geo?output=xml&key=google_key&q=Montreal%2C+QC%2C+Canada I get a warning error saying: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xE9 0x61 0x6C 0x2C If I plug the url that doesn't work into my browser I get the proper response so I'm too sure why it would crap out. I'm not too familiar with the different string encoding types but the query strings are the exact format so not sure why it would complain. Any help is appreciated. Let me know if you need any code. Thx. Quote Link to comment Share on other sites More sharing options...
schilly Posted October 3, 2008 Author Share Posted October 3, 2008 Here is the response from google: <?xml version="1.0" encoding="UTF-8"?> <kml xmlns="http://earth.google.com/kml/2.0"> <Response> <name>Montreal,QC,Canada</name> <Status> <code>200</code> <request>geocode</request> </Status> <Placemark id="p1"> <address>Montréal, QC, Canada</address> <AddressDetails Accuracy="4" xmlns="urn:oasis:names:tc:ciq:xsdschema:xAL:2.0"> <Country> <CountryNameCode>CA</CountryNameCode> <AdministrativeArea> <AdministrativeAreaName>QC</AdministrativeAreaName> <Locality> <LocalityName>Montréal</LocalityName> </Locality></AdministrativeArea></Country></AddressDetails> <Point> <coordinates>-73.639076,45.545447,0</coordinates> </Point></Placemark></Response></kml> I think it has something to do with the french character in Montreal. Quote Link to comment Share on other sites More sharing options...
schilly Posted October 3, 2008 Author Share Posted October 3, 2008 Well I switched it to the CSV response and got it working. Not sure what was going on with the xml response. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.