title: how to detect encoding of html FileReader?
body: <p>txt file maybe utf8/GB2312,.... but if upload to my server, i got ascii only. how to detect file encoding, so i can set in readAsText()?</p>
  
  <pre><code>$("#fileinput").change(function(evt){
    if (!checkSupport())return; 
    var f = evt.target.files[0]; 
    if (!f) return;
    var r = new FileReader();
    r.onload = function(evt){   //file loaded successfuly
      g_fname=f.name;
      g_contents = evt.target.result;
      curpage.val(0);
      read_article();
    }
    r.readAsText(f,'GB2312');
  });
  </code></pre>