title: Getting INVALID_REQUEST from Google Maps API for valid addresses
body: <p>I'm doing some tests with Google Maps API and for some reason there is valid addresses that return status INVALID_REQUEST for no apparent reason. Here is my php code</p>
  
  <pre><code>    $request_url = "https://maps.googleapis.com/maps/api/geocode/xml?address=".urlencode($address);
      $xml = simplexml_load_file($request_url) or die("url not loading");
      $status = $xml-&gt;status;
      return $status;
  </code></pre>
  
  <p>$address example:</p>
  
  <pre><code>    $address = "R. Espírito Santo, Viana, ES, Brasil" // status INVALID_REQUEST 
  </code></pre>
  
  <p>but if I try to access the URL directly it return status OK</p>
  
  <p><a href="https://maps.googleapis.com/maps/api/geocode/xml?address=R.%20Esp%C3%ADrito%20Santo,%20Viana,%20ES,%20Brasil" rel="nofollow">https://maps.googleapis.com/maps/api/geocode/xml?address=R.%20Espírito%20Santo,%20Viana,%20ES,%20Brasil</a></p>
  
  <p>For some addresses it returns OK, but for others INVALID_REQUEST using exactly the same code changing only the address. Accessing the URL directly always returns OK.</p>
  
  <p>Any clues?</p>
  
  <p>thank you</p>