FileReader - which encodings are supported?
<p>Want to simlpy read user-input files as text.</p>

<p>Can rely on modern browser usage, so I use <strong>FileReader</strong> for that (which works like a charm).</p>

<pre><code>reader.readAsText(myfile, encoding);
</code></pre>

<p>I know that <code>encoding</code> defaults to UTF-8.</p>

<p>But as my users will upload files from various sources (Windows, Mac, Linux) and various browsers I ask the user to provide the encoding via a select box.</p>

<p>So e.g. for a western european windows text file I expect the user to choose e.g. windows-1252.</p>

<p>I was not able to find a list of supported encodings for FileReader (assuming this is at least depending on the browser).</p>

<p>I am not asking to auto-determine the encoding, I just want to fill my select box in a way like:</p>

<pre><code>&lt;select id="encoding"&gt;
   &lt;option value="windows-1252"&gt;Windows (Western Latin)&lt;/option&gt;
   &lt;option value="utf-8"&gt;UTF-8&lt;/option&gt;
   &lt;option value="..."&gt;...&lt;/option&gt;
&lt;/select&gt;
</code></pre>

<p><strong>So my questions are:</strong></p>

<ol>
<li>Where do I get a list of supported encodings to fill the option values?</li>
<li>How to determine the exact writing of those values (is it 'utf8' or 'UTF-8' or...) and are those depending on the OS / browser?</li>
<li>Does readAsText(myfile, unsupportedEncoding) throw any error which I can catch if encoding is not supported?</li>
</ol>

<p>I'd prefer not to use any major 3rd party libraries for that.</p>

<p><strong>Bonus Question:</strong></p>

<p>Is there a simple way to get <em>meaningful</em> translations of the values, e.g. <em>cp10029</em> means <em>Mac (Central European)</em>?</p>