title: file_get_contents - special characters in URL
body: <p>I am trying to get images from a remote server using <code>file_get_contents</code>. A URL to an image may contain spaces and/or special characters like ý, á, í, etc and when it does the operation fails with a HTTP code 400 - Bad Request. If I try to encode the url (or segments of that URL), using <code>urlencode</code> or <code>rawurlencode</code>, I get a 404. </p>
  
  <p>When the image URL does not contain spaces nor special chars it is downloaded without problems.</p>
  
  <p>I have a hunch that this has got something to do with encoding but I just can't figure it out.
  Is there an encoding option I'm missing? Is there a header that must be set for the request?</p>