title: Encoding accented characters using Node.js
body: <p>I need a simple way to handle this :</p>
  
  <pre><code>var express = require('express');
  
  var app = express();
  
  app.get('/', function(req, res) {
      res.setHeader('Content-Type', 'text/plain');
      res.charset = 'utf-8';
      res.end('éàï');
  })
  
  app.listen(8080);
  </code></pre>
  
  <p>So far all I get is this when I request :</p>
  
  <pre><code>http://localhost:8080/ :
  
  ï¿½ï¿½ï¿½
  </code></pre>
  
  <p><strong>Edit:</strong> if I change the way I set the charset to this :</p>
  
  <pre><code>app.get('/', function(req, res) {
      res.setHeader('Content-Type', 'text/plain; charset=utf-8');
      res.end('éàï');
  })
  </code></pre>
  
  <p>I actually get this :</p>
  
  <pre><code>���
  </code></pre>
  
  <p>Thanks,
  Max</p>