Xcode 9 ALWAYS converts line endings

Xcode 9 always converts the line endings of existing files on save.


I'm working on some cross-platform software and there are a few files that have CRLF line termination and should stay that way. For this reason I've always kept the "Convert existing files on save" option unchecked in the "Preferences" => "Text Editing" => "Editing" encodings/line endings area. This worked up through Xcode 8, but apparently no longer works in Xcode 9.


Any clues of how to prevent Xcode 9 from butchering these files? Or do I now have to resort to a separate text editor for all of them. Prior to this Xcode had become my preferred goto IDE for doing global cross-platform updates to some projects, but... 😠


(and yes, I did file a bug report rdar://34704190 )

I noticed the same. If you have the files in an Xcode project, you can set Line Endings per-file in "File Inspector" panel (together with Text Encoding, indentation etc.).

Have you heard anything on the bug report? We're also having these issues.

If you didn't realize this was going on, and added a line to the end of the file, the ending will be a LF when all the others are CR. Then try to delete that last line, and Xcode crashes without any attempt to send a crash log to Apple.


But thanks for the info about the individual file line ending settings. With that I was eventually able to clean the files I'd corrupted. (Turn the final LF into a CRLF and delete that without a crash.)

Xcode 9 ALWAYS converts line endings
 
 
Q