There is input to read the jade file:

 input#upload.(type='file', accept="text/xml, .csv") 

javascript:

 var file = document.getElementById('upload').files[0]; var reader = new FileReader(); reader.onloadend = function(e){ var file = e.target.result; }; reader.readAsBinaryString(file); 

In the script I get the line:

 "mail;name;ТеÑÑ" 

The last word is "Test". How to fix problems with encoding? And javascript and html page encoded "UTF-8".

  • one
    If you want text, why use readAsBinaryString instead of readAsText ? - Peter Olson
  • Peter Olson, thank you) And there will be no problems if users upload files with different encodings? - name
  • I'm not sure. I think that most likely, yes, there will be problems, but it is better to try than to guess. - Peter Olson
  • Ok, thanks - name
  • If possible, publish the solution found in response to your question . I am sure it will help many of your colleagues in the future. - Nicolas Chabanovsky

0