title: Why does my REST request return garbage data?
body: <p>I am trying to use LWP::Simple to make a GET request to a REST service. Here's the simple code:</p>
  
  <pre><code>use LWP::Simple;
  $uri = "http://api.stackoverflow.com/0.8/questions/tagged/php";
  $jsonresponse= get $uri;
  print $jsonresponse;
  </code></pre>
  
  <p>On my local machine, running Ubuntu 10.4, and Perl version 5.10.1:</p>
  
  <blockquote>
    <p>farhan@farhan-lnx:~$ perl --version<br>
    This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi  </p>
  </blockquote>
  
  <p>I can get the correct response and have it printed on the screen. E.g.:</p>
  
  <blockquote>
    <p>farhan@farhan-lnx:~$ head -10 output.txt<br>
    {<br>
     "total": 1000,<br>
     "page": 1,<br>
     "pagesize": 30,<br>
     "questions": [<br>
       {<br>
         "tags": [<br>
           "php",<br>
           "arrays",<br>
           "coding-style"<br>
    (... snipped ...)</p>
  </blockquote>
  
  <p>But on my host's machine to which I SSH into, I get <em>garbage</em> printed on the screen for the same exact code. I am assuming it has something to do with the encoding, but the REST service does not return the character set type in the response, so how do I force LWP::Simple to use the correct encoding? Any ideas what may be going on here?</p>
  
  <p>Here's the version of Perl on my host's machine:</p>
  
  <blockquote>
    <p>[dredd]$ perl --version<br>
    This is perl, v5.8.8 built for x86_64-linux-gnu-thread-multi  </p>
  </blockquote>