Extra carriage returns in atom


#1

Hi,

I am working with some files in Windows 8.1 that I exported from MS SQL server. When viewing the files in Atom 0.155.0 I get extra carriage returns:

Is there a setting in atom to stop the carriage returns from being displayed in this way? So far I have tried using the “Line Ending Converter” and “windows-carriage-return-remover” packages, but to no avail.

Thanks very much


#2

Have you tried turning on the “Show Invisibles” setting to see what is actually in the file?


#3

Invisibles are on in the screenshot (apologies for the dark theme). The blank lines between the text each contain a single carriage return.


#4

I don’t see any invisibles at the end of the lines 1, 3, 5, 7 or 9. Do you have the CR invisible set to something blank?


#5

All my invisibles are set to the defaults. This does make me wonder what is causing the linebreaks at the end of lines 1,3,5,7 and 9 because it looks like there’s nothing at all there. There is nothing I can copy and moving the cursor just proceeds to the next line.


#6

I’d say try installing the hex package and see what the bytes are in the file.


#7

It seems that when I use the “Generate Scripts” tool in SQL Server Management studio and select to save the scripts as unicode, every second character is set to 0x00. If I open one of these files in Atom I get the behaviour in my screenshot above.

Sublime and Emacs seem to be able to handle this however and do not display linefeeds on lines of their own. Emacs’s hexl-mode confirms that every second character is 0x00.

If I use “Generate Scripts” and select to save the scripts as ASCII this doesn’t happen and when the file is opened in Atom it looks as expected.


#8

Every second character being NUL means that it is being saved as UTF-16 BE (I think). You should be able to use the encoding selector on the right side of your status bar to change from UTF-8 to whichever of the UTF-16 versions works.


#9

That’s done the trick thanks very much – I selected UTF-16 LE. BE didn’t work and produced garbled text.