Ver Mensaje Individual
  #6 (permalink)  
Antiguo 19/12/2008, 14:52
eurodoblon
 
Fecha de Ingreso: enero-2008
Mensajes: 303
Antigüedad: 18 años, 8 meses
Puntos: 0
Respuesta: problema codificion utf-8

ENCONTRE LA SOLUCION.
En este script.
Código PHP:
<?php

require_once('Connections'); 

define("MAPS_HOST", "maps.google.com");
define("ABQIAAAAV22DtOnxh0_Z7RZc9fr_aRQ_IQDpnXTNUhI1-_yUX8z_JhQ2fRT5IFf-81wYM31nkDwQAGjJyAHuHg", "abcdefg");

// Opens a connection to a MySQL server

if (!$remota) {
  die(
"Not connected : " . mysql_error());
}

// Set the active MySQL database
$db_selected = mysql_select_db($database_remota, $remota);
if (!
$db_selected) {
  die(
"Can\'t use db : " . mysql_error());
}

// Select all the rows in the restaurantes table

 
// Initialize delay in geocode speed
$delay = 0;
$base_url = "http://" . MAPS_HOST . "/maps/geo?output=xml" . "&key=" . KEY;

// Iterate through the rows, geocoding each direccion
  
$geocode_pending = true;

 
    
$direccion = utf8_decode ($row_Recordset1['direccion'].",".$row_Recordset1['localidad'].",".$row_Recordset1['restaurante'] .","."ES");
    echo 
$direccion;
    
$id = $row["id"];
    
$request_url = $base_url . "&q=" . urlencode($direccion);
    
$xml = simplexml_load_file($request_url) or die("url not loading");
var_dump($xml);

    
$status = $xml->Response->Status->code;
    if (
strcmp($status, "200") == 0) {
      
// Successful geocode
      
$geocode_pending = false;
      
$coordinates = $xml->Response->Placemark->Point->coordinates;
      
$coordinatesSplit = split(",", $coordinates);
      
// Format: Longitude, Latitude, Altitude
      
$lat = $coordinatesSplit[1];
      
$lng = $coordinatesSplit[0];

      
$query = "UPDATE  " .
             
" SET lat = '$lat', lng = '$lng' " .
             
" WHERE  = '$_POST[nombrerest]'";
      
$update_result = mysql_query($query);
      if (!
$update_result) {
        die(
"Invalid query: " . mysql_error());
      }
    } else if (
strcmp($status, "620") == 0) {
      
// sent geocodes too fast
      
$delay += 100000;
    } else {
      
// failure to geocode
      
$geocode_pending = false;
      echo 
"direccion " . $direccion . " failed to geocoded. </br>";
      echo 
"Received status " . $status . "\n";
    }
    
usleep($delay);
 
?>
Sustuir

Código PHP:
$base_url = "http://" . MAPS_HOST . "/maps/geo?output=xml" . "&key=" . KEY; 
por:
Código PHP:
$base_url = "http://" . MAPS_HOST . "/maps/geo?output=xml" . "&key=" . KEY ."&oe=utf-8"; 
Lo dejo por si le sirve a alguien.

Poderia ver el resultado en http://www.muchorestaurante.com