title: Having trouble using php json_encode on local server
body: <p>In my controller I'm getting product data from Affilinet API in the form of xml, and creating an html string for product listing. After that I use php <code>json_encode</code> function to encode an array containing that html, something like</p>
  
  <pre><code>$data = array('listHtml' =&gt; $listHtml,'pagingHtml':$pagingHtml);
  echo json_encode($data);
  </code></pre>
  
  <p>On my staging and live servers, the code is working perfectly fine, but with the same data, the code is returning me this on local server</p>
  
  <pre><code>{"listHtml":null,"pagingHtml":"some html"}
  </code></pre>
  
  <p>The $listHtml includes some german characters. The problem is that on my online servers, the code treats $listHtml as UTF-8 encoded, but on local server it's treated as something else.</p>
  
  <p>Other than that, if I print out a string including some German characters, it works fine on online servers but the German characters are messed up on local server. So how do I configure my local server to interpret text as UTF-8 encoded</p>