title: Get/set file encoding with javascript's FileReader
body: <p>I am struggling with the following problem. Using javascript I would like to change the character set of a file content and display this content to the user. </p>
  
  <p>I have an input:file form. On change I am reading the content </p>
  
  <pre><code>$('#form input:file').change(function(event){                   
     file = this.files[0];
     reader = new FileReader();
     reader.onload = function(event) {
        result = event.target.result.replace(/\n/g,'&lt;br /&gt;');
        $('#filecontents').html(result);
     });
     reader.readAsText(file);
  })
  </code></pre>
  
  <p>The file is in Windows-1251. I would like to convert the content of the file to another encoding and after that present it to the user.</p>
  
  <p>Is this possible to achieve with javascript?</p>
  
  <p>Regards</p>