title: Unicode URL for file_get_contents() function in PHP
body: <p>It's seems to file_get_contents() automatically encodes url by urlencode().
  Even if url supplied as unicode. It's easy to replicate. Try following code.
  (PHP script must be saved in unicode format and uploads folder must have write permissions)</p>
  
  <pre><code>&lt;?php
  $mp3 = file_get_contents ( "http://translate.google.com/translate_tts?tl=pt&amp;q={rotações}" );
  file_put_contents ( "uploads/test.mp3", $mp3 );
  echo "&lt;audio id=\"player\" src=\"uploads/test.mp3\"&gt;&lt;/audio&gt;";
  echo "&lt;button onclick=\"document.getElementById('player').play()\" style=\"font-size:$font_size\"&gt;Play&lt;/button&gt;";
  ?&gt;
  </code></pre>
  
  <p>It must save sound file for portugese word "rotações". But it saves funny sound of "rota%C3%A7%C3%B5es". Can be easy confirmed by adding urlencode() to url.</p>
  
  <p>But if you put the url <a href="http://translate.google.com/translate_tts?tl=pt&amp;q=" rel="nofollow noreferrer">http://translate.google.com/translate_tts?tl=pt&amp;q=</a>{rotações} into browser address line -- you'll hear correct sound !</p>
  
  <p>Same problem if unicode url isn't hardcoded in the script but supplied from database.</p>
  
  <p>So my question -- how to force PHP to request correct unicode url, not processed by urlencode() ?</p>
  
  <p>P.S. I tried to replace file_get_contents() with CURL realization as described in <a href="https://stackoverflow.com/questions/15305048/php-file-get-contents-specific-encoding">PHP file_get_contents specific encoding</a> -- no effect..</p>