Text file display issues


#1

Opening a plain text file created by Powershell displays very wrong!

The file is actually single spaced, not double.
If I remove the special characters at the top, then save the file, everything gets NULL padded and the file is useless. Am I missing something here? Is there an encoding problem?
I’m on Windows 7 x64


#2

The special characters at the top are the byte-order mark or BOM. It tells editors that open it that the file is encoded in a Unicode format … typically UTF-16 (BE or LE depending on the order of the BOM). The reason why you see things get NULL padded when you take that out is that Atom assumes it is UTF-8 encoded … so you should leave it in. I’m pretty sure the double-spacing is because of the Windows CR and LF pair.


#3

Use CTRL+SHIFT+U to open up the encoding selection pane, or click the name of the encoding in the bottom-right corner to choose which encoding the file is displayed in.

Or, install default-encoding and never worry about it again.


#4

Ah, there we go!

Thanks for that explanation.


#5

Closing this since it is resolved.


#6