title: Angular 7+: how to only allow upload of files with content in utf-8?
body: <p>I am using angular 7+, I have a simple function to do the upload files and read their contents, but I would like to know how to identify the encode of document content, to only allow documents with encode utf-8.</p>
  
  <pre><code>async uploadFile(event) {
      var document;
      var reader = new FileReader();
      let file = event.target.files[0];
  
      reader.onload = ((file: any) =&gt; {
        return (e: any) =&gt; {
          document.description = e.srcElement.result;
          document.title = title;
          document.fileName = file.name;
        }
      })(file);
  
      reader.readAsText(file);
    }
  </code></pre>
  
  <p>Thanks.</p>