Bug report: Atom mangles Windows ANSI files containing extended characters


I’m a longtime user of Notepad++, but for my needs it has been getting worse and worse. It is now painfully slow when editing an 18 MB (250,000 line) text file. So I decided to try Atom.

The good news is that Atom is very fast!

The bad news is that Atom trashed my text file! (It’s a good thing I had a backup.)

The file is Windows “plain text,” which Windows Notepad calls “ANSI.” That’s an 8-bit encoding sometimes called Windows-1252.

I made a tiny file which demonstrates the problem. It contains two copies of the following line, which contains two special characters, ° and ²:

No. 9.8 °C/km is not equal to 9.8 m/sec². That's just a coincidence of numbers.

The first copy of the line is the correct version. The second is the mangled version, after it was loaded and then saved in Atom.

Also, at the end of the text file you can see what happens if you try to enter ° and ² via the Windows “Alt 248” and “Alt 0178” keypad sequences, in Atom. That doesn’t work right, either.

Here’s the text file:

Here’s a hexadecimal dump:


Here’s what it looks like in Notepad:


I tried to post a link to what it looks like in Atom, but the discuss.atom.io site says:

Sorry you cannot post a link to that host.


The best place to submit bug reports is the GitHub repo. The developers get notified about new issues posted there.