Hello,

I try to send geocode request utf8 encoding. But it doesnt works. My
some address have some turkish characters like Ç,Ş,Ü,Ğ,İ.

I try some encoding functions. How can i fix this problem.

Sample address is "Fatih Çarşısı, Şeref Şirin Mah. 42030 Konya"

this is geocode request url:

http://maps.google.com/maps/geo?q=Fatih+%C3%87ar%C5%9F%C4%B1s%C4%B1%2C+%C5%9Eeref+%C5%9Eirin+Mah.+42030+Konya&output=xml&ie=UTF8&oe=UTF8&sensor=false&key=ABQIAAAABVahlN5LCczfe_p0Sh2tSRQShSgYeU7S5mDQtD-m_Fs_PWRlIBRS3PvxiOCVrvWL74dSCAgYoUraQg


but it returns 'Konya, Turkey'

This is my code.

$base_url = "http://"; . MAPS_HOST . "/maps/geo?";
        // Iterate through the rows, geocoding each address
        while ($row = @mysql_fetch_assoc($result)) {
          $geocode_pending = true;

          while ($geocode_pending) {
                $adres=str_replace(" mah."," mh.,",$row["address"]);
                $adres=str_replace(" MAH."," mh.,",$adres);
                $adres=str_replace(" cad."," cd.,",$adres);


                //$address = $adres." , ".str_replace("/",",",$row["Konum"]);
                $address = $adres;
                $id = $row["id"];
                $adres=urlencode(mb_convert_encoding($address,"UTF-8","auto"));
                $request_url = $base_url . "q=" .
$adres."&output=xml&ie=UTF8&oe=UTF8&sensor=false&key=".KEY;

        echo("<br>.".$request_url);
        echo "<br>adress.$address";
        $status = $xml->Response->Status->code;

                $geocode_pending=false;
                echo "<br>status:$status.";
                if (strcmp($status, "200") == 0) {

                        $geocode_pending = false;
                         $adres=$xml->Response->Placemark->address;
                         $coordinates = 
$xml->Response->Placemark->Point->coordinates;
                          $coordinatesSplit = split(",", $coordinates);
                          $lat = $coordinatesSplit[1];
                          $lng = $coordinatesSplit[0];


                        $sorgu="UPDATE markers SET
formatted_address='$adres',lat='$lat',lng='$lng' where id=".
$row["id"];
                        echo $sorgu;
                        if (!mysql_query($sorgu,$con)){  die('Error: ' . 
mysql_error());  }

                } else if (strcmp($status, "620") == 0) {
                // sent geocodes too fast
                  $delay += 100000;

                } else {

                  // failure to geocode
                  $geocode_pending = false;
                  echo "Address " . $address . " failed to geocoded. ";
                  echo "Received status " . $status . "\n";
                }

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API V2" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to