title: How do I do content encoding properly in node.js?
body: <p>Given the following code</p>
  
  <pre><code>var http = require('http');
  
  http.createServer(function (request, response) {
      response.writeHead(200, {'Content-Type': 'text'});
      response.write("Okay – so recently I’ve started presenting a session to various groups involving the well known IOC container “StructureMap”", 'utf8');
      response.end();
  }).listen(8080);
  </code></pre>
  
  <p>I get the output</p>
  
  <blockquote>
    <p>Okay â€“ so recently Iâ€™ve started
    presenting a session to various groups
    involving the well known IOC container
    â€œStructureMapâ€ â€“ and despite
    being pretty clear about the contents
    of said talk Iâ€™m getting quite a bit
    of backlash for demonstrating anything
    that even remotely resembles service
    location.</p>
  </blockquote>
  
  <p>This is clearly wrong - but is it wrong because I've got the wrong encoding (UTF8 should do it... right?... right?) or is it wrong because node is doing something weird?</p>
  
  <p>I am using the latest version of node, cloned from github master yesterday.</p>