Scandinavian characters and file_get_contents()
<p>I am loading contents from a URL; the URL is in the form www.example.com/?keyword=something. I get the specific content based on user's keyword like this:</p>

<pre><code>$url = 'www.example.com/?';
$url = $url."keyword=$something";

function getData ($url) {

    $data = file_get_contents($url);

    return $data;
}
</code></pre>

<p>The original data contains Scandinavian characters like Ö or Å. After loading, those characters are not any more readable. How to fix this special character problem? </p>

<p>UPDATE: </p>

<p>I changed the code this way:</p>

<pre><code>function getData ($url) {

   $data = urlencode(file_get_contents($url));
   $data = urldecode($data);

    return $data;
}
</code></pre>

<p>Didn't help either. Also  <code>$data = utf8_decode(urldecode($data));</code> and <code>echo utf8_decode(urldecode(getData($keyword)));</code> don't help. What am I doing whrong here?</p>
