<p dir="auto">Calling <code class="notranslate">atom.cmd filename</code> on windows, or opening with <code class="notranslate">node atom.js filename</code> , always ends up with UTF-8 encoding, even if its not. Auto-detect doesn't seem to be triggered when opened from arguments.</p>
<p dir="auto">However, manually triggering auto-detect seems to do the trick.</p>
<p dir="auto">But this is serious, as there is no warning of any kind, and the file will end up being filled up with garbage due to wrong encoding, with no way to reverse it.</p>
<p dir="auto">Atom should try to guess the encoding when opening a file as best as it can and only if it fails, fallback to the default encoding option (which was implemented a few days ago).</p>
<p dir="auto">Missing libraries (that would presumably help with this issue) shouldn't be a factor here. If there isn't any library that could be used, one should be created from 0 or maybe patch the one that could get the job done with as little amount of work as possible.</p>
<p dir="auto">The main issue here is that Atom will try to open files in UTF8 (or the default encoding, if set), which will potentially break any non-UTF8 files. And that, imho, is not an acceptable/valid behavior for any editor.</p>
<p dir="auto">This should be tagged as 1.0 blocker.</p>
<p dir="auto">Also, maybe this could help:</p>
<ul dir="auto">
<li><a href="https://github.com/mooz/node-icu-charset-detector">https://github.com/mooz/node-icu-charset-detector</a></li>
<li><a href="https://www.npmjs.org/package/detect-encoding" rel="nofollow">https://www.npmjs.org/package/detect-encoding</a></li>
</ul>